16 two pointers - other
Last updated
Was this helpful?
Last updated
Was this helpful?
这个又分几种类型。具体参照附录。
同向的:
-- 这题做的时候就寻思着会不会有flip k个的,然后果然有了
-- 一开始还以为是dp,然而还是slliding windows
-- 如果找3个的shortest distance 怎么找?这又让人联想到k个了...无穷无尽呀
-- 感觉跟28 brute force有一点点像
795 Number of Subarrays with Bounded Maximum
对撞型:
在两个数组上的和sorting类的:
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)
的快慢指针: