def catAndMouse(x, y, z):
x = abs(x - z)
y = abs(y - z)
if x == y:
return 'Mouse C'
elif x < y:
return 'Cat A'
else:
return 'Cat B'
'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글
[HackerRank-python] Picking Numbers (0) | 2022.07.11 |
---|---|
[HackerRank-python] Forming a Magic Square (0) | 2022.07.10 |
[HackerRank-python] Electronics Shop (0) | 2022.07.10 |
[HackerRank-python] Counting Valleys (0) | 2022.07.10 |
[HackerRank-python] Drawing Book (0) | 2022.07.07 |