16 two pointers - other
这个又分几种类型。具体模板参照附录。
同向的:
26 Remove Duplicate from Sorted Array
80 Remove Duplicate from Sorted Array II
L521 Remove Duplicate Numbers in Array
487 Max Consecutive Ones II -- 这题做的时候就寻思着会不会有flip k个的,然后果然有了
1004 Max Consecutive Ones III -- 一开始还以为是dp,然而还是slliding windows
245 Shortest Word Distance III
Shortest Word Distance follow up -- 如果找3个的shortest distance 怎么找?这又让人联想到k个了...无穷无尽呀
1437 Check If All 1's Are at Least Length K Places Away -- 感觉跟28 brute force有一点点像
L1870 Number of Substrings with All Zeroes
2511 Maximum Enemy Forts That Can Be Captured
1855 Maximum Distance Between a Pair of Values
795 Number of Subarrays with Bounded Maximum
对撞型:
LinkedList 的快慢指针:
19 Remove Nth Node From End of List
在两个数组上的和sorting类的:
349 Intersection of Two Arrays
350 Intersection of Two Arrays II
other related :
360 Sort Transformed Array
487 Max Consecutive Ones II
L406 Minimum Size Subarray Sum
L144 Interleaving Positive and Negative Numbers
L364 Trapping Rain Water II (407)
Last updated