일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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줄정리
- 월간
- Problem Solving
- 뭐든
- 화상영어
- 파비최
- 괜찮음
- 쓰릴오브파이트
- 운동
- FIT XR
- leetcode
- 리얼 클래스
- English
- Daily Challenge
- Writing
- 사이드
- 스탭퍼
- 10분
- 영어공부
- 프로젝트
- 읽기
- 만화도
- 영어원서읽기
- 개발자
- 잡생각
- 링피트
- 매일
- 30분
- realclass
Archives
- Today
- Total
파비의 매일매일 공부기록
Today's Challenge 본문
https://leetcode.com/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-t ree/
Find a Corresponding Node of a Binary Tree in a Clone of That Tree - 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
문제의 의도를 잘 모르겠다.
아니 왜 original 하고 cloned를 비교하는 거지 =_=
class Solution:
def getTargetCopy(self, original: TreeNode, cloned: TreeNode, target: TreeNode) -> TreeNode:
def inorder(o: TreeNode, c: TreeNode):
if o:
inorder(o.left, c.left)
if o is target:
self.ans = c
inorder(o.right, c.right)
inorder(original, cloned)
return self.ans
반응형
'Problem Solving > LeetCode' 카테고리의 다른 글
Today's Challenge (0) | 2022.05.19 |
---|---|
Today's Challenge (0) | 2022.05.18 |
Today's Challenge (0) | 2022.05.16 |
Today's Challenge (0) | 2022.05.15 |
Today's Challenge (0) | 2022.05.14 |
Comments