Use `HashSet`

to record numbers that have occured once so that when meet them the second time, we know it's NOT a Happy Number and it'll be a endless loop.

```
HashSet<Integer> occured = new HashSet<>();
public boolean isHappy(int n) {
if (occured.contains(n)) return false;
if (n == 1) return true;
occured.add(n);
int res = 0;
while (n != 0) {
res += Math.pow(n % 10, 2);
n /= 10;
}
return isHappy(res);
}
```