• + 0 comments

    Java one-liner:

    static String catAndMouse(int x, int y, int z) {
            return Math.abs(x - z) < Math.abs(y - z) ? "Cat A" : Math.abs(x - z) > Math.abs(y - z) ? "Cat B" : "Mouse C";
        }