Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Sort by Removing by StefanPochmann
from itertools import *
from operator import ge
def sort_by_removing(values: list) -> list:
return list(compress(values, map(ge, values, accumulate(values, max))))
Aug. 4, 2025
Comments: