Skip to content

Latest commit

 

History

History
78 lines (42 loc) · 6.09 KB

File metadata and controls

78 lines (42 loc) · 6.09 KB

Two Pointers LeetCode Problems

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

Problems

Easy

# Problem Language Time Space Explanation
9 Palindrome Number Python O(n) O(1) Explanation

| 21 | Merge Two Sorted Lists | Python | O(n) | O(1) | Explanation |

| 83 | Remove Duplicates from Sorted List | PHP | O(n) | O(1) | Explanation |

| 125 | Valid Palindrome | PHP | O(n) | O(1) | Explanation |

| 160 | Intersection of Two Linked Lists | PHP | O(n) | O(1) | Explanation |

| 203 | Remove Linked List Elements | PHP | O(n) | O(1) | Explanation |

| 206 | Reverse Linked List | PHP | O(n) | O(1) | Explanation |

| 234 | Palindrome Linked List | PHP | O(n) | O(1) | Explanation |

| 349 | Intersection of Two Arrays | Python | O(n) | O(1) | Explanation |

| 350 | Intersection of Two Arrays II | Python | O(n) | O(1) | Explanation |

| 409 | Longest Palindrome | Python | O(n) | O(1) | Explanation |

| 671 | Second Minimum Node In a Binary Tree | Python | O(n) | O(1) | Explanation |

| 693 | Binary Number with Alternating Bits | Python | O(n) | O(1) | Explanation |

| 762 | Prime Number of Set Bits in Binary Representation | Python | O(n) | O(1) | Explanation |

| 876 | Middle of the Linked List | Python | O(n) | O(1) | Explanation |

| 1800 | Maximum Ascending Subarray Sum | C++ | O(n) | O(1) | Explanation |

| 2877 | Create a DataFrame from List | Python | O(n) | O(1) | Explanation |

| 2878 | Get the Size of a DataFrame | Python | O(n) | O(1) | Explanation |

| 2881 | Create a New Column | Python | O(n) | O(1) | Explanation |

Medium

# Problem Language Time Space Explanation
2 Add Two Numbers Python O(n) O(1) Explanation

| 11 | Container With Most Water | JavaScript | O(n) | O(1) | Explanation |

| 24 | Swap Nodes in Pairs | Python | O(n) | O(1) | Explanation |

| 61 | Rotate List | C++ | O(n) | O(1) | Explanation |

| 82 | Remove Duplicates from Sorted List II | PHP | O(n) | O(1) | Explanation |

| 2058 | Find the Minimum and Maximum Number of Nodes Between Critical Points | C++ | O(n) | O(1) | Explanation |

| 2265 | Count Nodes Equal to Average of Subtree | JavaScript | O(n) | O(1) | Explanation |

| 2721 | Execute Asynchronous Functions in Parallel | TypeScript | O(n) | O(1) | Explanation |

Hard

# Problem Language Time Space Explanation
23 Merge k Sorted Lists Python O(n) O(1) Explanation

| 25 | Reverse Nodes in k-Group | Python | O(n) | O(1) | Explanation |

| 2472 | Maximum Number of Non-overlapping Palindrome Substrings | JavaScript | O(n) | O(1) | Explanation |