일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Tags
- Python Implementation
- data science
- shiba
- 시바견
- 715. Range Module
- Protocol
- 컴퓨터의 구조
- 109. Convert Sorted List to Binary Search Tree
- Decorator
- 프로그래머스
- iterator
- Python
- 파이썬
- Class
- Convert Sorted List to Binary Search Tree
- attribute
- kaggle
- LeetCode
- 315. Count of Smaller Numbers After Self
- Generator
- 43. Multiply Strings
- Python Code
- t1
- Substring with Concatenation of All Words
- concurrency
- 밴픽
- DWG
- 30. Substring with Concatenation of All Words
- 운영체제
- Regular Expression
Archives
- Today
- Total
목록2. Add Two Numbers (1)
Scribbling
LeetCode: 2. Add Two Numbers
1. 노가다성 답안 class Solution: def addTwoNumbers(self, l1, l2, up=0): if l1 != None and l2 != None: val1 = l1.val val2 = l2.val val = (val1 + val2 + up) % 10 up = (val1 + val2 + up) // 10 ret_node = ListNode(val=val) ret_node.next = self.addTwoNumbers(l1.next, l2.next, up=up) elif l1 == None and l2 != None: val2 = l2.val val = (val2 + up) % 10 up = (val2 + up) // 10 ret_node = ListNode(val=val) ret_..
Computer Science/Coding Test
2021. 8. 10. 13:39