leetcode-1631 - Path With Minimum Effort

動機 最小路徑? no,no 最短路徑!!! ...

September 19, 2021 · 2 min · zhengcf

leetcode-659 - Split Array into Consecutive Subsequences

動機 跟patch array一樣很有魔法的題目 ...

September 14, 2021 · 2 min · zhengcf

leetcode-1438 - Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit

動機 sliding window但是用heap去找window的最大最小 ...

August 16, 2021 · 2 min · zhengcf

leetcode-862 - Shortest Subarray with Sum at Least K

動機 What makes this problem hard is that we have negative values. sliding window + monotone stack = monotone queue prefix sum in fly + hash ...

August 15, 2021 · 1 min · zhengcf

leetcode-355 - Design Twitter

動機 原本以為很複雜,結果異常的簡單 ...

August 10, 2021 · 2 min · zhengcf

leetcode-632 - Smallest Range Covering Elements from K Lists

動機 就heap ...

August 5, 2021 · 1 min · zhengcf

leetcode-480 - Sliding Window Median

動機 對的資料結構帶你上天堂 ...

August 4, 2021 · 2 min · zhengcf

leetcode-630 - Course Schedule III

動機 巧妙地讓heap描述當前總和的組成 ...

August 3, 2021 · 2 min · zhengcf

leetcode-767 - Reorganize String

動機 先看621 ...

August 1, 2021 · 1 min · zhengcf

leetcode-973 - K Closest Points to Origin

動機 sort與heap差在一個能插入,另一個不能 ...

August 1, 2021 · 1 min · zhengcf