Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Clear category for Reverse Every Ascending by Pavellver
def reverse_ascending(items: list[int]):
result_list = []
temp_list = [0]
for item in items:
if item > temp_list[-1]:
temp_list.append(item)
else:
result_list += temp_list[::-1]
temp_list = [0]
temp_list.append(item)
result_list += temp_list[::-1]
return [nonzero for nonzero in result_list if nonzero]
March 12, 2023
Comments: