Answers for "happy number leetcode"

0

happy number leetcode

// Formula Math Happy Number

let x1 = Math.pow(2, 2);
let y1 = Math.pow(0, 2);
let z1 = Math.pow(3, 2);

console.log(`${x1} + ${y1} + ${z1} = ${x1+y1+z1}`);

let x2 = Math.pow(1, 2);
let y2 = Math.pow(3, 2);

console.log(`${x2} + ${y2} = ${x2+y2}`);

let x3 = Math.pow(1, 2);
let x4 = Math.pow(0, 2);

console.log(`${x3} + ${x4} = ${x3+x4}`);

// output: 203 -> 13 -> 10 -> 1
Posted by: Guest on June-18-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language