I found that in the range from 1 to 99, only these 12 numbers can transform to 1;

And for an Integer, biggest value can be transformed is lower that 810(9*9*10), transform again, the value decrease.

```
class Solution {
public:
bool isHappy(int n) {
int ha[] = {1, 68, 86, 13, 31, 82, 28, 19, 91, 23, 32, 44};
int i;
for(int j = 0; j < 8; j++){
i = 0;
for(; i < sizeof(ha)/sizeof(int); i++){
if(ha[i] == n) return true;
}
int next = 0, tmp = n;
while(tmp != 0){
next += ((tmp%10) * (tmp%10));
tmp /= 10;
}
n = next;
}
return false;
}
};
```