[+] Prep9 is_sorted_sublist

This commit is contained in:
Hykilpikonna
2022-03-13 21:28:18 -04:00
parent b86a971284
commit beb933e623
+5 -1
View File
@@ -66,8 +66,12 @@ def is_sorted_sublist(lst: list, b: int, e: int) -> bool:
False
>>> is_sorted_sublist([2, 7, 3, 4, 5], 2, 5) # Equivalent to is_sorted([2, 7, 3, 4, 5][2:5])
True
>>> is_sorted_sublist([-1, 0, 0, -1], 0, 3)
True
>>> is_sorted_sublist([-1, 0, 0, -1], 0, 4)
False
"""
# TODO: implement this function
return all(lst[i] <= lst[i + 1] for i in range(b, e - 1))
def min_index(lst: list) -> int: