← back
Two Pointers
204 questions · 0 seen
All Two Pointers problems
Two Pointers
1
Actions
⊣ Practice
Two Pointers
⊣ Quiz
Two Pointers
Problems
⊣ 5 Longest Palindromic Substring
Medium
⊣ 11 Container With Most Water
Medium
⊣ 15 3Sum
Medium
⊣ 16 3Sum Closest
Medium
⊣ 18 4Sum
Medium
⊣ 19 Remove Nth Node From End of List
Medium
⊣ 26 Remove Duplicates from Sorted Array
Easy
⊣ 27 Remove Element
Easy
⊣ 28 Find the Index of the First Occurrence in a String
Easy
⊣ 31 Next Permutation
Medium
⊣ 42 Trapping Rain Water
Hard
⊣ 61 Rotate List
Medium
⊣ 75 Sort Colors
Medium
⊣ 80 Remove Duplicates from Sorted Array II
Medium
⊣ 82 Remove Duplicates from Sorted List II
Medium
⊣ 86 Partition List
Medium
⊣ 88 Merge Sorted Array
Easy
⊣ 125 Valid Palindrome
Easy
⊣ 141 Linked List Cycle
Easy
⊣ 142 Linked List Cycle II
Medium
⊣ 143 Reorder List
Medium
⊣ 148 Sort List
Medium
⊣ 151 Reverse Words in a String
Medium
⊣ 160 Intersection of Two Linked Lists
Easy
⊣ 165 Compare Version Numbers
Medium
⊣ 167 Two Sum II - Input Array Is Sorted
Medium
⊣ 189 Rotate Array
Medium
⊣ 202 Happy Number
Easy
⊣ 234 Palindrome Linked List
Easy
⊣ 283 Move Zeroes
Easy
⊣ 287 Find the Duplicate Number
Medium
⊣ 295 Find Median from Data Stream
Hard
⊣ 321 Create Maximum Number
Hard
⊣ 344 Reverse String
Easy
⊣ 345 Reverse Vowels of a String
Easy
⊣ 349 Intersection of Two Arrays
Easy
⊣ 350 Intersection of Two Arrays II
Easy
⊣ 392 Is Subsequence
Easy
⊣ 443 String Compression
Medium
⊣ 455 Assign Cookies
Easy
⊣ 457 Circular Array Loop
Medium
⊣ 475 Heaters
Medium
⊣ 481 Magical String
Medium
⊣ 522 Longest Uncommon Subsequence II
Medium
⊣ 524 Longest Word in Dictionary through Deleting
Medium
⊣ 532 K-diff Pairs in an Array
Medium
⊣ 541 Reverse String II
Easy
⊣ 556 Next Greater Element III
Medium
⊣ 557 Reverse Words in a String III
Easy
⊣ 567 Permutation in String
Medium
⊣ 581 Shortest Unsorted Continuous Subarray
Medium
⊣ 611 Valid Triangle Number
Medium
⊣ 633 Sum of Square Numbers
Medium
⊣ 647 Palindromic Substrings
Medium
⊣ 653 Two Sum IV - Input is a BST
Easy
⊣ 658 Find K Closest Elements
Medium
⊣ 680 Valid Palindrome II
Easy
⊣ 696 Count Binary Substrings
Easy
⊣ 719 Find K-th Smallest Pair Distance
Hard
⊣ 763 Partition Labels
Medium
⊣ 777 Swap Adjacent in LR String
Medium
⊣ 786 K-th Smallest Prime Fraction
Medium
⊣ 795 Number of Subarrays with Bounded Maximum
Medium
⊣ 809 Expressive Words
Medium
⊣ 821 Shortest Distance to a Character
Easy
⊣ 825 Friends Of Appropriate Ages
Medium
⊣ 826 Most Profit Assigning Work
Medium
⊣ 832 Flipping an Image
Easy
⊣ 838 Push Dominoes
Medium
⊣ 844 Backspace String Compare
Easy
⊣ 845 Longest Mountain in Array
Medium
⊣ 870 Advantage Shuffle
Medium
⊣ 876 Middle of the Linked List
Easy
⊣ 881 Boats to Save People
Medium
⊣ 905 Sort Array By Parity
Easy
⊣ 917 Reverse Only Letters
Easy
⊣ 922 Sort Array By Parity II
Easy
⊣ 923 3Sum With Multiplicity
Medium
⊣ 925 Long Pressed Name
Easy
⊣ 942 DI String Match
Easy
⊣ 948 Bag of Tokens
Medium
⊣ 962 Maximum Width Ramp
Medium
⊣ 969 Pancake Sorting
Medium
⊣ 977 Squares of a Sorted Array
Easy
⊣ 986 Interval List Intersections
Medium
⊣ 1023 Camelcase Matching
Medium
⊣ 1048 Longest String Chain
Medium
⊣ 1089 Duplicate Zeros
Easy
⊣ 1147 Longest Chunked Palindrome Decomposition
Hard
⊣ 1163 Last Substring in Lexicographical Order
Hard
⊣ 1237 Find Positive Integer Solution for a Given Equation
Medium
⊣ 1332 Remove Palindromic Subsequences
Easy
⊣ 1346 Check If N and Its Double Exist
Easy
⊣ 1385 Find the Distance Value Between Two Arrays
Easy
⊣ 1455 Check If a Word Occurs As a Prefix of Any Word in a Sentence
Easy
⊣ 1471 The k Strongest Values in an Array
Medium
⊣ 1498 Number of Subsequences That Satisfy the Given Sum Condition
Medium
⊣ 1508 Range Sum of Sorted Subarray Sums
Medium
⊣ 1537 Get the Maximum Score
Hard
⊣ 1574 Shortest Subarray to be Removed to Make Array Sorted
Medium
⊣ 1577 Number of Ways Where Square of Number Is Equal to Product of Two Numbers
Medium
⊣ 1616 Split Two Strings to Make Palindrome
Medium
⊣ 1679 Max Number of K-Sum Pairs
Medium
⊣ 1697 Checking Existence of Edge Length Limited Paths
Hard
⊣ 1712 Ways to Split Array Into Three Subarrays
Medium
⊣ 1721 Swapping Nodes in a Linked List (PRO)
Medium
⊣ 1750 Minimum Length of String After Deleting Similar Ends
Medium
⊣ 1754 Largest Merge Of Two Strings
Medium
⊣ 1755 Closest Subsequence Sum
Hard
⊣ 1764 Form Array by Concatenating Subarrays of Another Array
Medium
⊣ 1768 Merge Strings Alternately (PRO)
Easy
⊣ 1782 Count Pairs Of Nodes
Hard
⊣ 1793 Maximum Score of a Good Subarray
Hard
⊣ 1813 Sentence Similarity III
Medium
⊣ 1850 Minimum Adjacent Swaps to Reach the Kth Smallest Number
Medium
⊣ 1855 Maximum Distance Between a Pair of Values
Medium
⊣ 1861 Rotating the Box
Medium
⊣ 1877 Minimize Maximum Pair Sum in Array
Medium
⊣ 1898 Maximum Number of Removable Characters
Medium
⊣ 1960 Maximum Product of the Length of Two Palindromic Substrings
Hard
⊣ 1961 Check If String Is a Prefix of Array (PRO)
Easy
⊣ 1963 Minimum Number of Swaps to Make the String Balanced (PRO)
Medium
⊣ 2000 Reverse Prefix of Word (PRO)
Easy
⊣ 2014 Longest Subsequence Repeated k Times
Hard
⊣ 2035 Partition Array Into Two Arrays to Minimize Sum Difference
Hard
⊣ 2071 Maximum Number of Tasks You Can Assign
Hard
⊣ 2095 Delete the Middle Node of a Linked List
Medium
⊣ 2105 Watering Plants II
Medium
⊣ 2108 Find First Palindromic String in the Array
Easy
⊣ 2109 Adding Spaces to a String
Medium
⊣ 2110 Number of Smooth Descent Periods of a Stock
Medium
⊣ 2122 Recover the Original Array
Hard
⊣ 2130 Maximum Twin Sum of a Linked List
Medium
⊣ 2149 Rearrange Array Elements by Sign
Medium
⊣ 2161 Partition Array According to Given Pivot
Medium
⊣ 2193 Minimum Number of Moves to Make Palindrome
Hard
⊣ 2200 Find All K-Distant Indices in an Array
Easy
⊣ 2234 Maximum Total Beauty of the Gardens
Hard
⊣ 2300 Successful Pairs of Spells and Potions
Medium
⊣ 2332 The Latest Time to Catch a Bus
Medium
⊣ 2337 Move Pieces to Obtain a String
Medium
⊣ 2367 Number of Arithmetic Triplets
Easy
⊣ 2396 Strictly Palindromic Number
Medium
⊣ 2406 Divide Intervals Into Minimum Number of Groups
Medium
⊣ 2410 Maximum Matching of Players With Trainers
Medium
⊣ 2441 Largest Positive Integer That Exists With Its Negative
Easy
⊣ 2460 Apply Operations to an Array
Easy
⊣ 2462 Total Cost to Hire K Workers
Medium
⊣ 2465 Number of Distinct Averages
Easy
⊣ 2472 Maximum Number of Non-overlapping Palindrome Substrings
Hard
⊣ 2486 Append Characters to String to Make Subsequence
Medium
⊣ 2491 Divide Players Into Teams of Equal Skill
Medium
⊣ 2503 Maximum Number of Points From Grid Queries
Hard
⊣ 2511 Maximum Enemy Forts That Can Be Captured
Easy
⊣ 2540 Minimum Common Value
Easy
⊣ 2562 Find the Array Concatenation Value
Easy
⊣ 2563 Count the Number of Fair Pairs
Medium
⊣ 2565 Subsequence With the Minimum Score
Hard
⊣ 2570 Merge Two 2D Arrays by Summing Values
Easy
⊣ 2576 Find the Maximum Number of Marked Indices
Medium
⊣ 2592 Maximize Greatness of an Array
Medium
⊣ 2697 Lexicographically Smallest Palindrome
Easy
⊣ 2824 Count Pairs Whose Sum is Less than Target
Easy
⊣ 2825 Make String a Subsequence Using Cyclic Increments
Medium
⊣ 2856 Minimum Array Length After Pair Removals
Medium
⊣ 2903 Find Indices With Index and Value Difference I
Easy
⊣ 2905 Find Indices With Index and Value Difference II
Medium
⊣ 2911 Minimum Changes to Make K Semi-palindromes
Hard
⊣ 2938 Separate Black and White Balls
Medium
⊣ 2970 Count the Number of Incremovable Subarrays I
Easy
⊣ 2972 Count the Number of Incremovable Subarrays II
Hard
⊣ 3006 Find Beautiful Indices in the Given Array I
Medium
⊣ 3008 Find Beautiful Indices in the Given Array II
Hard
⊣ 3132 Find the Integer Added to Array II
Medium
⊣ 3186 Maximum Total Damage With Spell Casting
Medium
⊣ 3194 Minimum Average of Smallest and Largest Elements
Easy
⊣ 3218 Minimum Cost for Cutting Cake I
Medium
⊣ 3239 Minimum Number of Flips to Make Binary Grid Palindromic I
Medium
⊣ 3240 Minimum Number of Flips to Make Binary Grid Palindromic II
Medium
⊣ 3302 Find the Lexicographically Smallest Valid Sequence
Medium
⊣ 3316 Find Maximum Removals From Source String
Medium
⊣ 3403 Find the Lexicographically Largest String From the Box I
Medium
⊣ 3455 Shortest Matching Substring
Hard
⊣ 3503 Longest Palindrome After Substring Concatenation I
Medium
⊣ 3504 Longest Palindrome After Substring Concatenation II
Hard
⊣ 3534 Path Existence Queries in a Graph II
Hard
⊣ 3584 Maximum Product of First and Last Elements of a Subsequence
Medium
⊣ 3633 Earliest Finish Time for Land and Water Rides I
Easy
⊣ 3635 Earliest Finish Time for Land and Water Rides II
Medium
⊣ 3643 Flip Square Submatrix Vertically
Easy
⊣ 3645 Maximum Total from Optimal Activation Order
Medium
⊣ 3649 Number of Perfect Pairs
Medium
⊣ 3685 Subsequence Sum After Capping Elements
Medium
⊣ 3722 Lexicographically Smallest String After Reverse
Medium
⊣ 3734 Lexicographically Smallest Palindromic Permutation Greater Than Target
Hard
⊣ 3750 Minimum Number of Flips to Reverse Binary String
Easy
⊣ 3752 Lexicographically Smallest Negated Permutation that Sums to Target
Medium
⊣ 3766 Minimum Operations to Make Binary Palindrome
Medium
⊣ 3775 Reverse Words With Same Vowel Count
Medium
⊣ 3794 Reverse String Prefix
Easy
⊣ 3801 Minimum Cost to Merge Sorted Lists
Hard
⊣ 3814 Maximum Capacity Within Budget
Medium
⊣ 3823 Reverse Letters Then Special Characters in a String
Easy
⊣ 3844 Longest Almost-Palindromic Substring
Medium