📅  最后修改于: 2022-03-11 15:03:44.129000             🧑  作者: Mango
// cats and a mouse hackerrank solution javascript
function catAndMouse(x, y, z) {
let catADist = Math.abs(x -z);
let catBDist = Math.abs(y - z);
if(catADist > catBDist){
return "Cat B";
}else if(catADist < catBDist){
return "Cat A";
}else{
return "Mouse C";
}
}