pylist
指针题
一般没什么套路。String题和O(1)空间复杂度的Array题很可能需要用指针。
Examples
读写指针
539. Move Zeroes
283. Move Zeroes
521. Remove Duplicate Numbers in Array
844. Backspace String Compare
倍速指针
228. Middle of Linked List
876. Middle of the Linked List
主从指针
13. Implement strStr()
200. Longest Palindromic Substring
,也是背向,但不是背向双指针
对向双指针
415. Valid Palindrome
X-Sum
1. Two Sum
15. 3Sum
16. 3Sum Closest
18. 4Sum
背向双指针
460. Find K Closest Elements
cumsum
53. Maximum Subarray
525. Contiguous Array
双向 cumsum
1422. Maximum Score After Splitting a String
238. Product of Array Except Self
inverse cumsum
560. Subarray Sum Equals K