Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
For loop comparing previous values solution in Clear category for Sort by Removing by kkkkk
def sort_by_removing(values: list) -> list:
"""Return only the values in the list that are ascending."""
prev_num = 0
new_values = []
for num in values:
if num >= prev_num:
new_values.append(num)
prev_num = num
return new_values
Oct. 6, 2020
Comments: