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-546 - Remove Boxes

動機 三維dp!? 這真的能在45分做出來? ...

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-399 - Evaluate Division

動機 建圖去走 ...

August 14, 2021 · 2 min · zhengcf

leetcode-1361 - Validate Binary Tree Nodes

動機 把需要的spec定義出來就好 ...

August 14, 2021 · 1 min · zhengcf

leetcode-492 - Construct the Rectangle

動機 對ㄟ,除2是一半,sqrt也是一半 insight: sqrt也是一半 ...

August 14, 2021 · 1 min · zhengcf

leetcode-433 - Minimum Genetic Mutation

動機 BFS硬幹 ...

August 13, 2021 · 2 min · zhengcf

leetcode-147 - Insertion Sort List

動機 複習linked list的處理手法 ...

August 13, 2021 · 2 min · zhengcf