Two Pointers
(1)两个 pointers 从头往后走:
题目归类:
lc28: Implement strStr()
lc3: Longest Substring Without Repeating Characters
lc76: Minimum Window Substring
lc26 & lc80: Remove Duplicates from Sorted Array & II
lc83 & lc82: Remove Duplicates from Sorted List & II
lc27: Remove Element
lc19: Remove Nth Node From End of List
lc92: Reverse Linked list II
lc61: Rotate List
lc30: Substring with Concatenation of All Words
lc20: Swap Nodes in Pairs(2) 两个pointers从两头往中间走:
(3) 两个pointers控制两个不同的数组或链表:
Last updated