leetcode-1109 - Corporate Flight Bookings

動機 太久沒打真的會忘記 這是prefix sum阿 ...

September 13, 2021 · 1 min · zhengcf

leetcode-1856 - Maximum Subarray Min-Product

動機 把84的monotonic stack介紹借過來一下 1 2 3 .left. 7 .right. 2 right的數字大小一定是大於7!! left的數字一定是等於7 所以在這個區間中7一定是最小 這樣就可以用在題 ...

August 19, 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-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-525 - Contiguous Array

動機 用prefix sum紀錄偏移到哪邊了 ...

August 10, 2021 · 1 min · zhengcf

leetcode-995 - Minimum Number of K Consecutive Bit Flips

動機 下次處理flip就要這樣處理 ...

August 4, 2021 · 1 min · zhengcf

leetcode-303 - Range Sum Query - Immutable

動機 複習prefix sum ...

July 29, 2021 · 1 min · zhengcf

leetcode-238 - Product of Array Except Self

動機 由左到右與由右到左去組合!! ...

July 21, 2021 · 1 min · zhengcf

leetcode-209 - Minimum Size Subarray Sum

動機 與560不同他可以用sliding window prefix sum + binary search prefix sum in fly + sliding window ...

July 20, 2021 · 2 min · zhengcf