--- tags: AC LeetCode 刷題讀書會 - 2023 --- # 2023/09/03(日) 每週 LeetCode 刷題 ## 刷題題號 - [100. Same Tree](https://leetcode.com/problems/invert-binary-tree/) ## 解題思路 Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes have the same value. <pre style='background-color:#ggg'> 給與兩個二元樹分別為 p 和 q 的根,寫一個函式來檢查它們是否相同。 如果兩個二叉樹結構相同並且節點具有相同的值,則認為它們是相同的。 </pre> ## 回報格式 - 請 Fork 此 Replit 連結(https://replit.com/@AllenLi23/AC-LeetCode-Js-100-Same-Tree)後,進行程式碼解題,並於完成後更新到 Replit 中,再將連結貼至「解題分享區」來與大家交流做法。 解題分享區 --- 讀書會議流程: ex. 21:05開始 #簽到表:待確認 https://docs.google.com/spreadsheets/d/1gc16rrF-yZNs845z_nYrdgDIiSECOJok30dNLyQm69A/edit#gid=534323210 1. 題目說明。 2. 題目解析(BigO(n))。 4. 成員分享解題思路。 5. 問題與討論。 <!-- No.0 (請依序排序下去) name: name (回報範例) lighthouse: lighthouse Replit:https://replit.com/@AllenLi23/AC-LeetCode-Js-100-Same-Tree-Allen --> <!-- No.1 name: Kai lighthouse: pythonforeye@gmail.com Replit: https://replit.com/@Beginneraboutli/AC-LeetCode-Js-100-Same-Tree#index.js --> <!-- No.2 name: Jack Hung lighthouse: lhhungx@gmail.com Replit:https://replit.com/@LungHsuanHung/AC-LeetCode-Go-100-Same-Tree#solution/solution.go --> <!-- No.3 name: Bun lighthouse: bun.coding@gmail.com Replit:https://replit.com/@Shu-YinChen/AC-LeetCode-Js-100-Same-Tree#index.js --> <!-- No.4 name: Ben lighthouse: a84012807@gmail.com Replit:https://replit.com/@a84012807/AC-LeetCode-Js-100-Same-Tree-1 -->