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

Function catAndMouse

Hackerrank_problems/Cats and a Mouse/solution.py:7–13  ·  view source on GitHub ↗
(x, y, z)

Source from the content-addressed store, hash-verified

5import sys
6
7def catAndMouse(x, y, z):
8 if(abs(z-x)==abs(z-y)): # checking whether both the cats reach at the same time or not
9 return "Mouse C" # if yes, returns Mouse C
10 elif(abs(z-x)>abs(z-y)): # checking if the cat B reaches earlier or Cat A
11 return "Cat B"
12 else:
13 return "Cat A"
14
15if __name__ == '__main__':
16 fptr = open(os.environ['OUTPUT_PATH'], 'w')

Callers 1

solution.pyFile · 0.85

Calls 1

absFunction · 0.85

Tested by

no test coverage detected