Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
2 liner solution in Clear category for Sort Except Zero by swagg010164
from typing import Iterable
def except_zero(items: list) -> Iterable:
sort_ = iter(sorted(filter(lambda x: x != 0, items)))
return [k if k == 0 else next(sort_) for k in items]
Jan. 11, 2020
Comments: