LeetCode 筆記 - 1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree
⚠️ 舊文提醒:本文發佈於約 4 年前,部分內容或指令可能已過時,請斟酌參考。
題目在此 1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree
給兩個 Binary Tree 一棵樹是另一顆的複製,還有 target node
請回傳 target node 在複製樹上的 reference
解題思維
很單純就是 Tree traversal
跑完一次就解決了
程式碼
1 | # Definition for a binary tree node. |