
202. Happy Number
·
Algorithm
Happy Number - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1. 집합을 이용한 풀이 from functools import reduce class Solution: def isHappy(self, n: int) -> bool: def phase_one(num): return list(map(int, list(str(num)))) def phase_two(input_list): return reduce(lambda acc, cur: acc + cur..