MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / breakDirection

Function breakDirection

Misc/Monotonic_Array/solution2.py:24–32  ·  view source on GitHub ↗
(direction, previousInt, currentInt)

Source from the content-addressed store, hash-verified

22
23
24def breakDirection(direction, previousInt, currentInt):
25 # Get direction
26 difference = currentInt - previousInt
27 # Check if directions is maintained
28 if direction > 0:
29 # If direction and difference have the same pattern
30 return difference < 0
31 # Else return the opposite
32 return difference > 0

Callers 1

isMonotonicFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected