일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 3줄정리
- 스탭퍼
- Writing
- 영어원서읽기
- 리얼 클래스
- 미드시청
- 만화도
- 잡생각
- 개발자
- realclass
- 운동
- 30분
- English
- 읽기
- 파비최
- 링피트
- 10분
- 사이드
- 괜찮음
- 쓰릴오브파이트
- 월간
- 매일
- 영어공부
- 뭐든
- 프로젝트
- leetcode
- Daily Challenge
- Problem Solving
- FIT XR
- 화상영어
Archives
- Today
- Total
파비의 매일매일 공부기록
2023.12.09 Today's Challenge 본문
https://leetcode.com/problems/binary-tree-inorder-traversal/
Binary Tree Inorder Traversal - LeetCode
Can you solve this real interview question? Binary Tree Inorder Traversal - Given the root of a binary tree, return the inorder traversal of its nodes' values. Example 1: [https://assets.leetcode.com/uploads/2020/09/15/inorder_1.jpg] Input: root = [1,nu
leetcode.com
트리 순회 문제!
class Solution:
def inorderTraversal(self, root: Optional[TreeNode]) -> List[int]:
if not root:
return []
return self.inorderTraversal(root.left) + [root.val] + self.inorderTraversal(root.right)
반응형
'Problem Solving > LeetCode' 카테고리의 다른 글
2023.12.11 Today's Challenge (0) | 2023.12.11 |
---|---|
2023.12.10 Today's Challenge (0) | 2023.12.10 |
2023.12.08 Today's Challenge (0) | 2023.12.08 |
2023.12.07 Today's Challenge (0) | 2023.12.07 |
2023.12.06 Today's Challenge (0) | 2023.12.06 |
Comments