LeetCode

394. Decode String

394. Decode String 這一個題目是 Stack 常見的考題做法 1. 如果我們遇到連續的字元,就把「字元」

1004. Max Consecutive Ones III

1004. Max Consecutive Ones III 這個題目是基於題目 485. Max Consecutive Ones

1446. Consecutive Characters

1446. Consecutive Characters class Solution: def maxPower(self, s: str)

12. Integer to Roman

12. Integer to Roman 直接把規則寫出來 class Solution: def intToRoman(self,

862. Shortest Subarray with Sum at Least K

862. Shortest Subarray with Sum at Least K 這個題目其實很近似於雙指針的問題,我在看完題目後的第一個想法是,

117. Populating Next Right Pointers in Each Node II

117. Populating Next Right Pointers in Each Node II "

1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree

1379. Find a Corresponding Node of a Binary Tree in

116. Populating Next Right Pointers in Each Node

116. Populating Next Right Pointers in Each Node 這一題要考的點是對進行 BFS

700. Search in a Binary Search Tree

700. Search in a Binary Search Tree 如果說題目只是問「樹」中是否存在一個節點有某個值,

450. Delete Node in a BST

450. Delete Node in a BST 這個題目給定的條件可以很簡單:給定一個數值,要我們在二元搜尋樹中找到哪個節點的數值等於此值,並且刪掉他。