// The cube root is a whole number. For example, 27 is a perfect cube, as ∛27 or (27)**1/3 = 3
function isPerfectCubeRoot(x) {
x = Math.abs(x);
const cubeRoot = Math.round(Math.pow(x, 1.0 / 3.0));
return Math.pow(cubeRoot, 3) === x;
}
console.log(isPerfectCubeRoot(16));
console.log(isPerfectCubeRoot(64));
console.log(isPerfectCubeRoot(128));
console.log(isPerfectCubeRoot(27));
console.log(isPerfectCubeRoot(25));
console.log(isPerfectCubeRoot(-64));
console.log(isPerfectCubeRoot(-27));
console.log(isPerfectCubeRoot(729));
/*
run:
false
true
false
true
false
true
true
true
*/