Fix: Ensure all skills are tracked as files, not submodules
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
def monotonic(l: list):
|
||||
"""Return True is list elements are monotonically increasing or decreasing.
|
||||
>>> monotonic([1, 2, 4, 20])
|
||||
True
|
||||
>>> monotonic([1, 20, 4, 10])
|
||||
False
|
||||
>>> monotonic([4, 1, 0, -10])
|
||||
True
|
||||
"""
|
||||
if len(l) <= 2:
|
||||
return True
|
||||
|
||||
increasing = all(l[i] <= l[i + 1] for i in range(len(l) - 1))
|
||||
decreasing = all(l[i] >= l[i + 1] for i in range(len(l) - 1))
|
||||
|
||||
return increasing or decreasing
|
||||
Reference in New Issue
Block a user