-
[LeetCode/Python] 258. Add Digits - A0232023_PPS/2주차 2023. 7. 18. 13:49
- 문제

- 코드
class Solution: def addDigits(self, num: int) -> int: l = list(map(int, str(num))) while(len(l) > 1): num = 0 for i in l: num += i l = list(map(int, str(num))) return l[0]'2023_PPS > 2주차' 카테고리의 다른 글
[Programmers/Python] 하샤드 수 - A026 (0) 2023.07.19 [LeetCode/Python] 342. Power of Four - A025 (0) 2023.07.18 [LeetCode/Python] 860. Lemonade Change - A024 (0) 2023.07.18 [BaekJoon/Python] 핸드폰 요금 - A022 (0) 2023.07.18 [BaekJoon/Python] 플러그 - A021 (0) 2023.07.18