You are viewing a single comment's thread. Return to all comments →
JS, Javascript Solution:-
function catAndMouse(x, y, z) { const aMDistance = Math.abs(x-z) const bMDistance = Math.abs(y-z) if (aMDistance === bMDistance) return "Mouse C"; else if (aMDistance > bMDistance) return 'Cat B'; return 'Cat A'; }
Seems like cookies are disabled on this browser, please enable them to open this website
Cats and a Mouse
You are viewing a single comment's thread. Return to all comments →
JS, Javascript Solution:-