Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
[i:j][::-1] solution in Clear category for Reverse Every Ascending by flpo
def reverse_ascending(items):
indices = [i+1 for i in range(len(items) -1) if items[i] >= items[i+1]]
for i, j in zip([0] + indices, indices + [len(items)]):
yield from items[i:j][::-1]
Dec. 10, 2018
Comments: