Slow and Fast Pointers
Next type is using two pointers with different speed of movement. Typically they starts from the left end, then the first pointer advances fast and give some feedback to the slow pointer and do some calculation.

Linked List Operations (*) https://leetcode.com/problems/linked-list-cycle/ https://leetcode.com/problems/linked-list-cycle-ii/ https://leetcode.com/problems/remove-nth-node-from-end-of-list/ https://leetcode.com/problems/rotate-list/ https://leetcode.com/problems/reorder-list/ https://leetcode.com/problems/palindrome-linked-list/
Sliding Window/Caterpillar Method
(*) https://leetcode.com/problems/number-of-subarrays-with-bounded-maximum/ https://leetcode.com/problems/find-k-th-smallest-pair-distance/ https://leetcode.com/problems/moving-stones-until-consecutive-ii/ https://leetcode.com/problems/count-pairs-of-nodes/ https://leetcode.com/problems/count-binary-substrings/ https://leetcode.com/problems/k-diff-pairs-in-an-array/
Others https://leetcode.com/problems/statistics-from-a-large-sample/ https://leetcode.com/problems/partition-labels/ https://leetcode.com/problems/magical-string/ https://leetcode.com/problems/friends-of-appropriate-ages/ https://leetcode.com/problems/longest-mountain-in-array/ https://leetcode.com/problems/shortest-subarray-to-be-removed-to-make-array-sorted/
Last updated
Was this helpful?