```
class Solution:
# @param {integer} n
# @return {boolean}
def isHappy(self, n):
count = []
while (True):
total = 0
count.append(str(n))
for i in str(n):
total += int(i) ** 2
n = str(total)
if n == "1":
return "True"
break
if n in count:
return "False"
break
```