Tree

145. Binary Tree Postorder Traversal

145. Binary Tree Postorder Traversal # Definition for a binary tree

279. Perfect Squares

279. Perfect Squares 這一個題目是一個非常彈性的題目,題目的問題非常簡單,找到最少個完全平方數其總和為題目給定的 n 。 首先第一個要先想到的是,我們要找的完全平方數,一定是比這個數還來的小,

994. Rotting Oranges

994. Rotting Oranges 題目的說明 題目有說明的有,腐爛的橘子會影響旁邊的好橘子,好橘子會爛掉,如果好橘子相連的好橘子有和爛橘子相連,過了一段時間後也會爛掉,如果有橘子沒有和任何的爛橘子相鄰就不會壞掉。

428. Serialize and Deserialize N-ary Tree

428. Serialize and Deserialize N-ary Tree

572. Subtree of Another Tree

# Definition for a binary tree node. # class TreeNode: # def __init_

589. N-ary Tree Preorder Traversal

589. N-ary Tree Preorder Traversal """ # Definition for

606. Construct String from Binary Tree

606. Construct String from Binary Tree # Definition for a binary

105. Construct Binary Tree from Preorder and Inorder Traversal

105. Construct Binary Tree from Preorder and Inorder Traversal 題目給出前序遍歷以及中序遍歷的順序,

337. House Robber III

337. House Robber III 這一題是 198. House Robber 和 213.

536. Construct Binary Tree from String

536. Construct Binary Tree from String 做這題之前可以先完成 606. Construct String