You are viewing a single comment's thread. Return to all comments →
// Complete the catAndMouse function below.
static string catAndMouse(int x, int y, int z) { int mouseToCatA = int.Abs(x - z); int mouseToCatB = int.Abs(y - z); if(mouseToCatA == mouseToCatB) { return "Mouse C"; } else if(mouseToCatA < mouseToCatB) { return "Cat A"; } else return "Cat B"; }
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Cats and a Mouse
You are viewing a single comment's thread. Return to all comments →
// Complete the catAndMouse function below.