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

Function findPos

Hackerrank_problems/kangaroo/solution1.py:12–16  ·  view source on GitHub ↗
(x1, v1, x2, v2)

Source from the content-addressed store, hash-verified

10# case2: both kangaroos can only meet if (x2-x1) % (v2-v1) is equal to 0
11
12def findPos(x1, v1, x2, v2):
13 if (x1 < x2 and v1 <= v2) or (abs(x2 - x1) % abs(v2 - v1) != 0):
14 print("NO")
15 else:
16 print("YES")
17
18
19# working

Callers 1

solution1.pyFile · 0.85

Calls 1

absFunction · 0.85

Tested by

no test coverage detected