1class Solution(object):2 def isHappy(self, n):3 hset = set()4 while n != 1:5 if n in hset:6 return False7 hset.add(n)8 n = sum([int(i) ** 2 for i in str(n)])9 else:10 return True
WPM •0 •0
ACC •0 •0
TIME •0