Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Ascending List by mikehult123
def is_ascending(a: list[int]) -> bool:
return len(set(a)) == len(a) and a == sorted(a)
print("Example:")
print(is_ascending([-5, 10, 99, 123456]))
assert is_ascending([-5, 10, 99, 123456]) == True
assert is_ascending([99]) == True
assert is_ascending([4, 5, 6, 7, 3, 7, 9]) == False
assert is_ascending([]) == True
assert is_ascending([1, 1, 1, 1]) == False
assert is_ascending([1, 3, 3, 5]) == False
print("The mission is done! Click 'Check Solution' to earn rewards!")
Jan. 13, 2023