| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- Generator
- 715. Range Module
- Regular Expression
- 109. Convert Sorted List to Binary Search Tree
- 밴픽
- shiba
- 43. Multiply Strings
- 30. Substring with Concatenation of All Words
- Protocol
- concurrency
- Class
- Convert Sorted List to Binary Search Tree
- DWG
- 315. Count of Smaller Numbers After Self
- 운영체제
- LeetCode
- kaggle
- attribute
- Python Code
- data science
- Python
- 컴퓨터의 구조
- 시바견
- Decorator
- Substring with Concatenation of All Words
- 프로그래머스
- Python Implementation
- 파이썬
- t1
- iterator
Archives
- Today
- Total
목록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