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-232 - Implement Queue using Stacks

動機 很經典,但沒想過可以用兩個stack ...

July 27, 2021 · 2 min · zhengcf

leetcode-341 - Flatten Nested List Iterator

動機 讓每個遞迴只負責一個工作 ...

July 25, 2021 · 2 min · zhengcf

leetcode-387 - First Unique Character in a String

動機 複習Counter ...

July 18, 2021 · 1 min · zhengcf

leetcode-239 - Sliding Window Maximum

動機 從sliding window到寫merge interval的變化版 ...

January 30, 2021 · 2 min · zhengcf