Tag: two-pointers
- 3Sum Closest
- 3Sum Smaller
- 3Sum With Multiplicity
- 3Sum
- 4Sum
- Add Two Polynomials Represented as Linked Lists
- Adding Spaces to a String
- Advantage Shuffle
- Append Characters to String to Make Subsequence
- Apply Operations to an Array
- Assign Cookies
- Backspace String Compare
- Bag of Tokens
- Boats to Save People
- Camelcase Matching
- Candy Crush
- Check If a Word Occurs As a Prefix of Any Word in a Sentence
- Check If N and Its Double Exist
- Check If String Is a Prefix of Array
- Checking Existence of Edge Length Limited Paths
- Circular Array Loop
- Closest Binary Search Tree Value II
- Closest Subsequence Sum
- Compare Version Numbers
- Container With Most Water
- Count Binary Substrings
- Count Pairs in Two Arrays
- Count Pairs Of Nodes
- Count Pairs Whose Sum is Less than Target
- Count the Number of Fair Pairs
- Count the Number of Incremovable Subarrays I
- Count the Number of Incremovable Subarrays II
- Create Maximum Number
- Delete the Middle Node of a Linked List
- DI String Match
- Divide Intervals Into Minimum Number of Groups
- Divide Players Into Teams of Equal Skill
- Dot Product of Two Sparse Vectors
- Duplicate Zeros
- Expressive Words
- Faulty Sensor
- Find All K-Distant Indices in an Array
- Find Beautiful Indices in the Given Array I
- Find Beautiful Indices in the Given Array II
- Find First Palindromic String in the Array
- Find Indices With Index and Value Difference I
- Find Indices With Index and Value Difference II
- Find K Closest Elements
- Find K-th Smallest Pair Distance
- Find Maximum Removals From Source String
- Find Median from Data Stream
- Find Positive Integer Solution for a Given Equation
- Find the Array Concatenation Value
- Find the Celebrity
- Find the Distance Value Between Two Arrays
- Find the Duplicate Number
- Find the Index of the First Occurrence in a String
- Find the Integer Added to Array II
- Find the Lexicographically Largest String From the Box I
- Find the Lexicographically Largest String From the Box II
- Find the Lexicographically Smallest Valid Sequence
- Find the Maximum Number of Marked Indices
- Flatten 2D Vector
- Flipping an Image
- Form Array by Concatenating Subarrays of Another Array
- Friends Of Appropriate Ages
- Get the Maximum Score
- Happy Number
- Heaters
- Intersection of Two Arrays II
- Intersection of Two Arrays
- Intersection of Two Linked Lists
- Interval List Intersections
- Is Subsequence
- K-diff Pairs in an Array
- K-th Smallest Prime Fraction
- Largest Merge Of Two Strings
- Largest Positive Integer That Exists With Its Negative
- Last Substring in Lexicographical Order
- Lexicographically Smallest Palindrome
- Linked List Cycle II
- Linked List Cycle
- Long Pressed Name
- Longest Chunked Palindrome Decomposition
- Longest Common Prefix After at Most One Removal
- Longest Mountain in Array
- Longest Palindrome After Substring Concatenation I
- Longest Palindrome After Substring Concatenation II
- Longest Palindromic Substring
- Longest String Chain
- Longest Uncommon Subsequence II
- Longest Word in Dictionary through Deleting
- Lowest Common Ancestor of a Binary Tree III
- Magical String
- Make String a Subsequence Using Cyclic Increments
- Max Number of K-Sum Pairs
- Maximize Greatness of an Array
- Maximum Coins Heroes Can Collect
- Maximum Distance Between a Pair of Values
- Maximum Enemy Forts That Can Be Captured
- Maximum Matching of Players With Trainers
- Maximum Number of Matching Indices After Right Shifts
- Maximum Number of Non-overlapping Palindrome Substrings
- Maximum Number of Points From Grid Queries
- Maximum Number of Removable Characters
- Maximum Score of a Good Subarray
- Maximum Total Beauty of the Gardens
- Maximum Total Damage With Spell Casting
- Maximum Twin Sum of a Linked List
- Maximum Width Ramp
- Meeting Rooms II
- Meeting Scheduler
- Merge Operations to Turn Array Into a Palindrome
- Merge Sorted Array
- Merge Strings Alternately
- Merge Two 2D Arrays by Summing Values
- Middle of the Linked List
- Minimize Maximum Pair Sum in Array
- Minimum Adjacent Swaps to Reach the Kth Smallest Number
- Minimum Array Length After Pair Removals
- Minimum Average of Smallest and Largest Elements
- Minimum Changes to Make K Semi-palindromes
- Minimum Common Value
- Minimum Length of String After Deleting Similar Ends
- Minimum Number of Flips to Make Binary Grid Palindromic I
- Minimum Number of Flips to Make Binary Grid Palindromic II
- Minimum Number of Moves to Make Palindrome
- Minimum Number of Swaps to Make the String Balanced
- Minimum Time to Eat All Grains
- Most Profit Assigning Work
- Move Pieces to Obtain a String
- Move Zeroes
- Moving Stones Until Consecutive II
- Next Greater Element III
- Next Palindrome Using Same Digits
- Next Permutation
- Number of Arithmetic Triplets
- Number of Distinct Averages
- Number of Subarrays with Bounded Maximum
- Number of Subsequences That Satisfy the Given Sum Condition
- Number of Ways Where Square of Number Is Equal to Product of Two Numbers
- One Edit Distance
- Palindrome Linked List
- Palindromic Substrings
- Pancake Sorting
- Partition Array According to Given Pivot
- Partition Array Into Two Arrays to Minimize Sum Difference
- Partition Labels
- Partition List
- Permutation in String
- Print Immutable Linked List in Reverse
- Product of Two Run-Length Encoded Arrays
- Push Dominoes
- Range Sum of Sorted Subarray Sums
- Rearrange Array Elements by Sign
- Recover the Original Array
- Remove Duplicates from Sorted Array II
- Remove Duplicates from Sorted Array
- Remove Duplicates from Sorted List II
- Remove Element
- Remove Nth Node From End of List
- Remove Palindromic Subsequences
- Reorder List
- Reverse Only Letters
- Reverse Prefix of Word
- Reverse String II
- Reverse String
- Reverse Vowels of a String
- Reverse Words in a String II
- Reverse Words in a String III
- Reverse Words in a String
- Rotate Array
- Rotate List
- Rotating the Box
- Sentence Similarity III
- Separate Black and White Balls
- Shortest Distance to a Character
- Shortest Matching Substring
- Shortest Subarray to be Removed to Make Array Sorted
- Shortest Unsorted Continuous Subarray
- Shortest Way to Form String
- Shortest Word Distance II
- Sort Array By Parity II
- Sort Array By Parity
- Sort Colors
- Sort Linked List Already Sorted Using Absolute Values
- Sort List
- Sort Transformed Array
- Split a Circular Linked List
- Split Two Strings to Make Palindrome
- Squares of a Sorted Array
- Strictly Palindromic Number
- String Compression
- Strobogrammatic Number
- Subsequence With the Minimum Score
- Successful Pairs of Spells and Potions
- Sum of Consecutive Subarrays
- Sum of Square Numbers
- Swap Adjacent in LR String
- Swapping Nodes in a Linked List
- The k Strongest Values in an Array
- The Latest Time to Catch a Bus
- The Wording Game
- Total Cost to Hire K Workers
- Trapping Rain Water
- Two Sum BSTs
- Two Sum II - Input Array Is Sorted
- Two Sum III - Data structure design
- Two Sum IV - Input is a BST
- Two Sum Less Than K
- Valid Palindrome II
- Valid Palindrome IV
- Valid Palindrome
- Valid Triangle Number
- Valid Word Abbreviation
- Watering Plants II
- Ways to Split Array Into Three Subarrays