LeetCode

121. Best Time to Buy and Sell Stock

121. Best Time to Buy and Sell Stock 這個題目算是面試的高頻題目,因為一個題目可以不斷的延伸,

435. Non-overlapping Intervals

435. Non-overlapping Intervals 這一題比前面的系列題目還稍難一點,但是思維很像一樣需要先將時間區間排序好,接著的目標是要找到移除幾個區間才能讓所有的會議都沒有重複的時間,這一題不能先把可以合併的時間都合併起來,因為當我們都合併起來之後,就會找不到到底哪一個需要被合併。 當所有的區間都按照順序排好後,

452. Minimum Number of Arrows to Burst Balloons

452. Minimum Number of Arrows to Burst Balloons 可以先看 435.

300. Longest Increasing Subsequence

300. Longest Increasing Subsequence 這一個題目是比較容易用直覺判斷出是動態規劃的題目,難的地方是這個題目的動態轉移方程式,這一個題目,如果要想到動態轉移方程式的話,那就是我們在第 i

516. Longest Palindromic Subsequence

516. Longest Palindromic Subsequence 這一題和 647. Palindromic Substrings 很像,只是其中的差異是一個問的是「

16. 3Sum Closest

16. 3Sum Closest

1. 2 Sum

1. 2 Sum Two sum 最簡單的就是用窮舉法把所有的組合都列出來,時間複雜度為 \(O(n^2)

1490. Clone N-ary Tree

1490. Clone N-ary Tree 這個題目是樹,題目要考察是否可以寫出遍歷整棵樹的程式碼,類似的題目是 133. Clone Graph

4. Median of Two Sorted Arrays

4. Median of Two Sorted Arrays 這個題目直覺的解法很簡單,做法也很多種,因為題目的邏輯很簡單,就是要找到中位數。

309. Best Time to Buy and Sell Stock with Cool down

309. Best Time to Buy and Sell Stock with Cool