Φόρτωση της άσκησης…
On a number line, two cats run toward the same mouse at the same speed. The function cats_and_a_mouse receives the position of Cat A as x, Cat B as y, and the mouse as z. Compare the distances to the mouse: return Cat A if the first cat is closer, Cat B if the second cat is closer, or Mouse C if the distances are equal.
1, 2, 3"Cat B"1, 3, 2"Mouse C"2, 5, 3"Cat A"def cats_and_a_mouse(x: int, y: int, z: int) -> str:
Συνδεθείτε για να δείτε το ιστορικό υποβολών
ΣύνδεσηΣυνδεθείτε για να χρησιμοποιήσετε τον AI Mentor
ΣύνδεσηThey run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.