You are viewing a single comment's thread. Return to all comments →
solution in GO
func abs(n int32) int32 { if n < 0 { return -n } return n }
// Complete the catAndMouse function below. func catAndMouse(x int32, y int32, z int32) string { a := abs(z - x) b := abs(z - y)
if a < b { return "Cat A" } else if b < a { return "Cat B" } return "Mouse C"
}
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 →
solution in GO
func abs(n int32) int32 { if n < 0 { return -n } return n }
// Complete the catAndMouse function below. func catAndMouse(x int32, y int32, z int32) string { a := abs(z - x) b := abs(z - y)
}