web123456

Happy Number - determine whether a number is a happy number

‘’’
Happy number has the following characteristics:
In a given carry system, the sum of squares of all digits of the number,
The resulting new number is again calculated as the sum of squares of all the digits. If you repeat it in this way, the final result must be 1.
Then it's the happy number, output true
Otherwise, output false
Example: Input 28, output true
28 → 22+82=68 → 62+82=100 → 12+02+0^2=1
‘’’