diff --git a/leetcode/202.py b/leetcode/202.py index 7c2c109..50d57c1 100644 --- a/leetcode/202.py +++ b/leetcode/202.py @@ -9,11 +9,15 @@ class Solution: total = 0 for number in str_n: total += int(number) * int(number) - if total == 1: return True if str(total) in status: return False status.append(str(total)) - self.isHappy(total, status) + return self.isHappy(total, status) + + +if __name__ == "__main__": + number = 19 + print(Solution().isHappy(19))