You are viewing a single comment's thread. Return to all comments →
JavaSolution
static String catAndMouse(int x, int y, int z) { int xDistance = Math.abs(z - x); int yDistance = Math.abs(z - y); return (xDistance == yDistance) ? "Mouse C" : (xDistance < yDistance) ? "Cat A" : "Cat B"; }
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 →
JavaSolution