4 16 37 58 89 145 42 20 4 It is a loop. so why?
you are not 4
how do you even know that he is happy?
Those numbers for which this process ends in 1 are happy numbers.
By the definition, only numbers end up with 1 are 'Happy'.
Definition also say "or it loops endlessly in a cycle which does not include 1"
I got your point, actually, any 'un-happy' number must fall in this range. You can even use this range to judge if a number is 'un-happy'. I am also wondering why.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.