We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98469a6 commit d9c998fCopy full SHA for d9c998f
101-500/202.py
@@ -0,0 +1,11 @@
1
+class Solution(object):
2
+ def isHappy(self, n, prev=[]):
3
+ nums = sum([int(x)**2 for x in list(str(n))])
4
+ if nums in prev:
5
+ return False
6
+ return self.isHappy(nums, prev+[nums]) if nums != 1 else True
7
+ """
8
+ :type n: int
9
+ :rtype: bool
10
11
+
0 commit comments