Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 3.81 KB

fast-slow-pointers.md

File metadata and controls

38 lines (29 loc) · 3.81 KB

Fast & Slow Pointers LeetCode Problems

A collection of LeetCode problems solved using Fast & Slow Pointers pattern techniques, explanations, and complexity analysis.

Problems

Easy

# Problem Language Time Space Explanation
141 Linked List Cycle JavaScript, PHP, Python O(n) O(1) Explanation
202 Happy Number PHP O(n) O(1) Explanation
234 Palindrome Linked List JavaScript, PHP O(n) O(1) Explanation
876 Middle of the Linked List Python O(n) O(1) Explanation

Medium

# Problem Language Time Space Explanation
19 Remove Nth Node From End of List JavaScript O(n) O(1) Explanation
142 Linked List Cycle II Python O(n) O(1) Explanation
143 Reorder List JavaScript O(n) O(1) Explanation
148 Sort List JavaScript O(n) O(1) Explanation
287 Find the Duplicate Number Python O(n) O(1) Explanation
457 Circular Array Loop Python O(n) O(1) Explanation
1559 Detect Cycles in 2D Grid Python O(n) O(1) Explanation
2095 Delete the Middle Node of a Linked List Java, JavaScript O(n) O(1) Explanation
2130 Maximum Twin Sum of a Linked List Java, JavaScript O(n) O(1) Explanation

Hard

# Problem Language Time Space Explanation
2360 Longest Cycle in a Graph JavaScript O(n) O(1) Explanation
2509 Cycle Length Queries in a Tree JavaScript O(n) O(1) Explanation
2608 Shortest Cycle in a Graph JavaScript O(n) O(1) Explanation
3887 Incremental Even-Weighted Cycle Queries Python O(n) O(1) Explanation