leetcode-718 - Maximum Length of Repeated Subarray

動機 超有意思的題目,只能用bottomup dp的題目!! 下次不能說topdown與bottomup的dp可以互換了 topdown dp與bottomup dp差在一個在前半段處理,另一個在後半段 因為上面的特質導致這題只能用bottomup ...

August 16, 2021 · 1 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-1248 - Count Number of Nice Subarrays

動機 atMost或是在回收時計算長度 ...

August 15, 2021 · 1 min · zhengcf

leetcode-1234 - Replace the Substring for Balanced String

動機 window中的東西可以亂生!! ...

August 15, 2021 · 2 min · zhengcf

leetcode-930 - Binary Subarrays With Sum

動機 用atMost秒殺 用prefix sum in fly也可以 ...

August 15, 2021 · 1 min · zhengcf

leetcode-1004 - Max Consecutive Ones III

動機 基本款sliding window ...

August 15, 2021 · 1 min · zhengcf

leetcode-992 - Subarrays with K Different Integers

動機 sliding window的新招式 binary search的range是左閉右開 lower bound: >=的第一個值 upper bound: >的第一個值 sliding window是左閉右閉 atMost: <=目標的所有區間總數 ...

August 15, 2021 · 1 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-632 - Smallest Range Covering Elements from K Lists

動機 就heap ...

August 5, 2021 · 1 min · zhengcf

leetcode-30 - Substring with Concatenation of All Words

動機 題目明明已經把same length上粗體了,還看不到… ...

August 5, 2021 · 1 min · zhengcf