'''

class Solution {

public boolean isHappy(int n) {

```
ArrayList<Integer> arr = new ArrayList<Integer>();
while (true) {
int sum = 0;
while (n != 0) {
int res = n % 10;
sum += res * res;
n /= 10;
}
if (sum == 1) {
return true;
}
if (arr.contains(sum)) {
break;
}
arr.add(sum);
n = sum;
}
return false;
}
```

}

'''