update 202

This commit is contained in:
sangge-rockpi 2024-01-22 16:11:57 +08:00
parent 0c146bb1a5
commit 85b45fcbfe

View File

@ -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))