LeetCode

269. Alien Dictionary

269. Alien Dictionary TODO class Solution: def alienOrder(self, words:

246. Strobogrammatic Number

246. Strobogrammatic Number 英文單字補充:Strobogrammatic Number 一個數字經過 180 旋轉後,如果還是一個合法的數字,

726. Number of Atoms

726. Number of Atoms 這一題的關鍵在於我們要知道怎麼把元素與價數分離出來。 頗析出來後就是用遞迴的方式來寫。 class Solution: def countOfAtoms(

1373. Maximum Sum BST in Binary Tree

1371. Maximum Sum BST in Binary Tree # Definition for a

94. Binary Tree Inorder Traversal

94. Binary Tree Inorder Traversal # Definition for a binary tree

222. Count Complete Tree Nodes

222. Count Complete Tree Nodes 線性搜索 # Definition for a binary

559. Maximum Depth of N-ary Tree

559. Maximum Depth of N-ary Tree """ # Definition

261. Graph Valid Tree

261. Graph Valid Tree 題目給定一個數字 n 和一個陣列,n 代表的是一個圖中,所用有的節點數量,

106. Construct Binary Tree from Inorder and Postorder Traversal

106. Construct Binary Tree from Inorder and Postorder Traversal postorder

124. Binary Tree Maximum Path Sum

124. Binary Tree Maximum Path Sum 這一題是後序遍歷的經典題目,後序遍歷的精神就是先將子樹的問題全部解決,再開始處理跟節點的問題,這一題要怎麼想到的確是屬於困難的題型。