From 85b45fcbfe7340315a0c29343d73c32add616253 Mon Sep 17 00:00:00 2001 From: sangge-rockpi <2251250136@qq.com> Date: Mon, 22 Jan 2024 16:11:57 +0800 Subject: [PATCH] update 202 --- leetcode/202.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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))