Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
yield from iterable solution in Clear category for Reverse Every Ascending by David_Jones
def reverse_ascending(items):
if not items:
return
sublist = [items[0]]
for i in range(1, len(items)):
if sublist[-1] < items[i]:
sublist.append(items[i])
else:
yield from reversed(sublist)
sublist = [items[i]]
yield from reversed(sublist)
July 5, 2019