LeetCodechevron_rightCategorieschevron_righttwo pointers
compare_arrows

two pointers

182 problems
Easy: 54Medium: 104Hard: 24

two pointers is one of the most repeated interview dimensions. Start with edge-safe fundamentals, then move into pattern-level trade-offs.

Interview Signal

Frequently tests problem modeling, edge handling, and verbal clarity.

Common Pitfall

Template-only answers break under follow-up questioning.

Practice Strategy

Practice in 3-5 problem rounds and always review complexity alternatives.

Recommended Progression

#TitleDifficulty
5

Longest Palindromic Substring

Find the longest contiguous palindromic substring in a given string using dynamic programming and two-pointer expansion …

Medium
11

Container With Most Water

Find two vertical lines that can form a container with the most water in a given array of heights.

Medium
15

3Sum

Given an integer array, return all unique triplets where the sum is zero using two-pointer scanning with careful duplica…

Medium
16

3Sum Closest

Find the sum of three integers in an array that is closest to a given target using two-pointer scanning.

Medium
18

4Sum

The 4Sum problem requires finding all unique quadruplets in an array that sum to a specific target value.

Medium
19

Remove Nth Node From End of List

Remove the nth node from the end of a linked list using a two-pointer approach to solve efficiently.

Medium
26

Remove Duplicates from Sorted Array

Learn how to remove duplicates from a sorted array in-place using two-pointer scanning while preserving element order.

Easy
27

Remove Element

Remove Element challenges you to remove a value from an array in-place using efficient two-pointer scanning and tracking…

Easy
28

Find the Index of the First Occurrence in a String

Locate the first occurrence of a substring within a string using a two-pointer scanning strategy and invariant tracking …

Easy
31

Next Permutation

Next Permutation is a medium-difficulty problem focusing on generating the next lexicographically greater permutation of…

Medium
42

Trapping Rain Water

Calculate the total trapped rain water using the elevation map array, leveraging dynamic programming and two-pointer pat…

Hard
61

Rotate List

Rotate a singly linked list to the right by k positions using careful pointer manipulation and two-pointer traversal tec…

Medium
75

Sort Colors

Sort Colors requires in-place reordering of an array using a two-pointer scanning strategy to group 0s, 1s, and 2s effic…

Medium
80

Remove Duplicates from Sorted Array II

Solve the problem of removing duplicates from a sorted array in-place, ensuring each element appears at most twice, usin…

Medium
82

Remove Duplicates from Sorted List II

Remove duplicates from a sorted linked list, leaving only distinct values, and return the modified list in sorted order.

Medium
86

Partition List

Partition a linked list such that all nodes less than x come before nodes greater than or equal to x while preserving re…

Medium
88

Merge Sorted Array

Merge two sorted arrays into the first array in non-decreasing order, using a two-pointer approach.

Easy
125

Valid Palindrome

Check if a given string is a valid palindrome by using two-pointer scanning and invariant tracking techniques.

Easy
141

Linked List Cycle

Determine if a given linked list contains a cycle using pointer manipulation or hashing, focusing on detecting repeated …

Easy
142

Linked List Cycle II

Identify the start of a cycle in a linked list using pointer manipulation, efficiently handling edge cases without modif…

Medium
143

Reorder List

Reorder List requires careful pointer manipulation in a singly linked list to interleave nodes from the ends without alt…

Medium
148

Sort List

Sort List requires sorting a singly linked list efficiently using pointer manipulation and merge sort for optimal perfor…

Medium
151

Reverse Words in a String

Reverse Words in a String requires reordering words using precise two-pointer scanning with careful space handling for e…

Medium
160

Intersection of Two Linked Lists

Given two linked lists, find the node where they intersect or return null if they do not.

Easy
165

Compare Version Numbers

Compare two version numbers by checking their individual revisions, considering missing revisions as zero, using a two-p…

Medium
167

Two Sum II - Input Array Is Sorted

Solve the Two Sum II problem efficiently using binary search over a valid answer space in a sorted array.

Medium
189

Rotate Array

Rotate Array challenges you to shift elements right by k steps using precise two-pointer scanning and invariant tracking…

Medium
202

Happy Number

Determine if a number is happy by repeatedly summing squares of digits using two-pointer scanning to detect cycles effic…

Easy
234

Palindrome Linked List

Solve Palindrome Linked List by finding the midpoint, reversing the second half, and comparing mirrored nodes in linear …

Easy
283

Move Zeroes

Move all zeros in an array to the end while preserving the order of non-zero elements using efficient in-place operation…

Easy
287

Find the Duplicate Number

The problem involves finding the duplicate number in an array of integers, using a binary search approach over the valid…

Medium
295

Find Median from Data Stream

Implement a MedianFinder class that supports adding numbers and finding the median from a data stream.

Hard
321

Create Maximum Number

Create Maximum Number involves merging digits from two arrays while preserving order, maximizing the resulting number.

Hard
344

Reverse String

Reverse a character array in-place using a two-pointer scanning technique, ensuring minimal memory and correct index swa…

Easy
345

Reverse Vowels of a String

Reverse Vowels of a String uses a two-pointer approach to reverse the vowels in a string while leaving the consonants in…

Easy
349

Intersection of Two Arrays

Find the intersection of two arrays while ensuring unique elements using efficient array scanning and hash lookups.

Easy
350

Intersection of Two Arrays II

Find the intersection of two arrays, accounting for multiple occurrences of the same number.

Easy
392

Is Subsequence

Determine if one string is a subsequence of another using state transition dynamic programming for accurate character ma…

Easy
443

String Compression

Compress a character array in-place by converting consecutive repeated characters into counts using two-pointer scanning…

Medium
455

Assign Cookies

Maximize content children by assigning at most one cookie per child using two-pointer scanning and greedy sorting techni…

Easy
457

Circular Array Loop

Detect whether a circular array contains a loop of consistent direction using efficient array scanning and hash lookup t…

Medium
475

Heaters

Determine the minimum heater radius to cover all houses using a binary search over potential radius values efficiently.

Medium
481

Magical String

Count the number of '1's in the first n characters of a magical string using two-pointer scanning and invariant tracking…

Medium
522

Longest Uncommon Subsequence II

Find the longest string in an array that is not a subsequence of any other string, using array scanning and hash checks …

Medium
524

Longest Word in Dictionary through Deleting

Find the longest word in the dictionary that can be formed by deleting characters from a string, using two-pointer scann…

Medium
532

K-diff Pairs in an Array

Solve K-diff Pairs in an Array by counting unique differences with a hash map or sorted two-pointer sweep.

Medium
541

Reverse String II

Reverse String II requires reversing segments of a string using two-pointer scanning while tracking invariants carefully…

Easy
556

Next Greater Element III

Find the next greater integer using the same digits as a given number with precise two-pointer scanning and invariant tr…

Medium
557

Reverse Words in a String III

Reverse Words in a String III involves reversing each word in a sentence using the two-pointer technique.

Easy
567

Permutation in String

Check if a string contains a permutation of another string using two-pointer scanning and hash table techniques.

Medium
581

Shortest Unsorted Continuous Subarray

Find the shortest unsorted continuous subarray that, if sorted, would sort the entire array.

Medium
611

Valid Triangle Number

Count all triplets in an integer array that satisfy the triangle inequality to form valid triangles efficiently using so…

Medium
633

Sum of Square Numbers

Given a non-negative integer c, determine if there are two integers whose squares sum to c.

Medium
647

Palindromic Substrings

Count all palindromic substrings in a given string using state transition dynamic programming for efficient evaluation.

Medium
653

Two Sum IV - Input is a BST

Determine if a binary search tree contains two nodes whose values sum to a target using efficient traversal and state tr…

Easy
658

Find K Closest Elements

Identify the k integers closest to a target x in a sorted array using binary search and two-pointer strategies efficient…

Medium
680

Valid Palindrome II

Check if a string can become a palindrome by deleting at most one character using two-pointer scanning and invariant tra…

Easy
696

Count Binary Substrings

Count Binary Substrings solves for the number of valid substrings with equal 0's and 1's, grouped consecutively in a bin…

Easy
719

Find K-th Smallest Pair Distance

Solve Find K-th Smallest Pair Distance by sorting nums, then binary searching the distance and counting valid pairs with…

Hard
763

Partition Labels

Partition a string into maximal parts so that each letter appears in only one segment, using two-pointer scanning.

Medium
777

Swap Adjacent in LR String

Transform one string into another by swapping adjacent 'L' and 'R' characters in a sequence of moves.

Medium
786

K-th Smallest Prime Fraction

Find the k-th smallest fraction from a sorted array of unique primes using a binary search over the answer space.

Medium
795

Number of Subarrays with Bounded Maximum

Count the number of contiguous subarrays with a bounded maximum value using a two-pointer approach.

Medium
809

Expressive Words

Expressive Words challenges you to determine if a word can be transformed into a given string by extending groups of rep…

Medium
821

Shortest Distance to a Character

Compute the minimum distance from each character in a string to a target character using efficient scanning techniques.

Easy
825

Friends Of Appropriate Ages

The Friends Of Appropriate Ages problem involves counting valid friend requests between people based on their ages with …

Medium
826

Most Profit Assigning Work

Assign workers to jobs maximizing total profit using difficulty, profit, and worker arrays efficiently with binary searc…

Medium
832

Flipping an Image

Flip each row of a binary matrix horizontally and invert its values efficiently using a two-pointer scanning approach.

Easy
838

Push Dominoes

In the "Push Dominoes" problem, you simulate the falling dominoes based on their initial states and determine their fina…

Medium
844

Backspace String Compare

Compare two strings after processing backspaces using efficient two-pointer scanning and careful invariant tracking to e…

Easy
845

Longest Mountain in Array

Find the length of the longest subarray forming a mountain pattern using state transitions and two-pointer logic efficie…

Medium
870

Advantage Shuffle

Maximize the advantage of nums1 over nums2 using a two-pointer greedy strategy, carefully tracking which elements beat o…

Medium
876

Middle of the Linked List

Find the middle node of a singly linked list using a two-pointer technique.

Easy
881

Boats to Save People

Find the minimum number of boats required to save all people, using a two-pointer approach for efficient pairing.

Medium
905

Sort Array By Parity

Reorder an integer array so all even numbers come before odd numbers using a precise two-pointer scanning method.

Easy
917

Reverse Only Letters

Reverse the characters of a string while skipping non-letter characters using a two-pointer technique.

Easy
922

Sort Array By Parity II

Sort an array where even numbers appear at even indices and odd numbers appear at odd indices using two-pointer scanning…

Easy
923

3Sum With Multiplicity

Count all unique triplets in an integer array whose sum equals the target, handling multiplicity efficiently using hashi…

Medium
925

Long Pressed Name

Check if a typed string could result from long pressing characters while typing a given name using a two-pointer scan.

Easy
942

DI String Match

Reconstruct a permutation from a DI string using two-pointer scanning, carefully tracking the increasing and decreasing …

Easy
948

Bag of Tokens

Maximize your score in the Bag of Tokens problem by strategically playing tokens with two-pointer scanning and greedy te…

Medium
962

Maximum Width Ramp

Find the maximum width of a ramp where nums[i] <= nums[j] for i < j using a two-pointer approach.

Medium
969

Pancake Sorting

Sort an array using pancake flips, leveraging two-pointer scanning and invariant tracking to iteratively position the la…

Medium
977

Squares of a Sorted Array

The problem involves squaring elements of a sorted array and returning the squares in non-decreasing order.

Easy
986

Interval List Intersections

This problem requires finding the intersection of two lists of intervals using a two-pointer technique with invariant tr…

Medium
1023

Camelcase Matching

Camelcase Matching is a medium difficulty problem where you match queries to a given pattern by inserting lowercase lett…

Medium
1048

Longest String Chain

Find the longest word chain by scanning arrays and using hash lookups to efficiently track predecessor-successor sequenc…

Medium
1089

Duplicate Zeros

Duplicate each zero in a fixed-length array in place, shifting elements right using a two-pointer scanning approach effi…

Easy
1147

Longest Chunked Palindrome Decomposition

Solve the "Longest Chunked Palindrome Decomposition" problem by using dynamic programming and string manipulation techni…

Hard
1163

Last Substring in Lexicographical Order

Identify the lexicographically last substring in a string using two-pointer scanning with invariant tracking efficiently…

Hard
1237

Find Positive Integer Solution for a Given Equation

Determine all positive integer pairs that satisfy a hidden monotonic function for a given target using binary search ove…

Medium
1332

Remove Palindromic Subsequences

This problem challenges you to remove palindromic subsequences from a string with a minimum number of steps using two-po…

Easy
1346

Check If N and Its Double Exist

Solve Check If N and Its Double Exist by scanning once and checking doubles or halves in a hash set.

Easy
1385

Find the Distance Value Between Two Arrays

Calculate the distance value between two integer arrays by determining how many elements in arr1 don't have a close coun…

Easy
1455

Check If a Word Occurs As a Prefix of Any Word in a Sentence

Determine the first word in a sentence where a given searchWord is a prefix using two-pointer scanning with string match…

Easy
1471

The k Strongest Values in an Array

Identify the k strongest values in an array using two-pointer scanning and careful tracking of the array's centre value.

Medium
1498

Number of Subsequences That Satisfy the Given Sum Condition

Count all non-empty subsequences in an integer array where the sum of the minimum and maximum elements is at most a targ…

Medium
1508

Range Sum of Sorted Subarray Sums

Compute the sum of sorted subarray sums efficiently using binary search over valid sum ranges and prefix sum accumulatio…

Medium
1537

Get the Maximum Score

Find the maximum possible score from two sorted arrays with a dynamic programming approach, leveraging partitioning and …

Hard
1574

Shortest Subarray to be Removed to Make Array Sorted

Find the shortest subarray to remove in order to make an array non-decreasing using binary search and two-pointer techni…

Medium
1577

Number of Ways Where Square of Number Is Equal to Product of Two Numbers

Find the number of triplets where the square of a number equals the product of two others, utilizing array scanning and …

Medium
1616

Split Two Strings to Make Palindrome

Determine if splitting two equal-length strings at a common index can form a palindrome using two-pointer scanning techn…

Medium
1679

Max Number of K-Sum Pairs

Max Number of K-Sum Pairs is a problem involving counting disjoint pairs with a given sum k in an array.

Medium
1697

Checking Existence of Edge Length Limited Paths

Solve the problem of checking if there exists a path between two nodes under edge length constraints using efficient tec…

Hard
1712

Ways to Split Array Into Three Subarrays

The problem requires finding the number of ways to split an array into three subarrays where each split meets a certain …

Medium
1721

Swapping Nodes in a Linked List

Swap nodes in a linked list using linked-list pointer manipulation and two pointers to solve this medium difficulty prob…

Medium
1750

Minimum Length of String After Deleting Similar Ends

Minimize string length by deleting similar characters from both ends repeatedly using a two-pointer technique.

Medium
1754

Largest Merge Of Two Strings

Construct the lexicographically largest merge from two strings using a two-pointer greedy scanning approach efficiently.

Medium
1755

Closest Subsequence Sum

Find the minimum absolute difference between a target goal and any subsequence sum using optimized dynamic programming a…

Hard
1764

Form Array by Concatenating Subarrays of Another Array

Determine if you can sequentially select disjoint subarrays from nums matching each group in order using two-pointer sca…

Medium
1768

Merge Strings Alternately

Merge two strings alternately, starting with the first string, and append extra characters when one string is longer.

Easy
1782

Count Pairs Of Nodes

Given a graph with nodes and edges, count pairs of nodes where the degree sum exceeds a given threshold for each query.

Hard
1793

Maximum Score of a Good Subarray

Maximize the score of a good subarray using binary search to explore the valid answer space with a focus on two-pointer …

Hard
1813

Sentence Similarity III

Sentence Similarity III asks if one sentence can be transformed into another by inserting a sentence inside it.

Medium
1850

Minimum Adjacent Swaps to Reach the Kth Smallest Number

Find the minimum number of adjacent swaps to reach the kth smallest wonderful integer from a given number string.

Medium
1855

Maximum Distance Between a Pair of Values

Find the maximum distance between a pair of values in two non-increasing integer arrays using binary search.

Medium
1861

Rotating the Box

Rotate a box represented by a character matrix, letting stones fall under gravity using precise two-pointer scanning and…

Medium
1877

Minimize Maximum Pair Sum in Array

Minimize the maximum pair sum in an array by optimally pairing its elements.

Medium
1898

Maximum Number of Removable Characters

Use binary search and a subsequence check to find the largest removable prefix that still keeps p inside s.

Medium
1961

Check If String Is a Prefix of Array

Determine if a string is a prefix of an array by concatenating initial elements, using two-pointer scanning efficiently.

Easy
1963

Minimum Number of Swaps to Make the String Balanced

Determine the minimum swaps to balance a bracket string using two-pointer scanning with invariant tracking efficiently.

Medium
2000

Reverse Prefix of Word

Reverse the prefix of a string starting from index 0 to the first occurrence of a given character.

Easy
2035

Partition Array Into Two Arrays to Minimize Sum Difference

Partition an integer array into two equal halves to minimize the absolute difference of their sums using dynamic program…

Hard
2071

Maximum Number of Tasks You Can Assign

Maximize the number of tasks that can be completed by efficiently using workers and magical pills.

Hard
2095

Delete the Middle Node of a Linked List

Efficiently remove the middle node from a linked list using two-pointer techniques and careful pointer updates to mainta…

Medium
2105

Watering Plants II

Simulate watering a row of plants with Alice and Bob using two-pointer scanning, tracking refills precisely for each ste…

Medium
2108

Find First Palindromic String in the Array

Return the first palindromic string from an array of words or an empty string if none exists.

Easy
2109

Adding Spaces to a String

Learn to efficiently insert spaces in a string using two-pointer scanning with invariant tracking in linear time.

Medium
2122

Recover the Original Array

Recover the Original Array helps you understand how to reverse-engineer an array from two subsets using array scanning a…

Hard
2130

Maximum Twin Sum of a Linked List

Find the maximum twin sum in a linked list by manipulating pointers efficiently and leveraging stack or reversal techniq…

Medium
2149

Rearrange Array Elements by Sign

Rearrange an array by alternating positive and negative integers using a two-pointer approach with invariant tracking.

Medium
2161

Partition Array According to Given Pivot

Rearrange an array around a pivot while maintaining relative order using a two-pointer scanning approach efficiently.

Medium
2193

Minimum Number of Moves to Make Palindrome

The problem challenges you to find the minimum number of adjacent swaps to make a string a palindrome.

Hard
2200

Find All K-Distant Indices in an Array

Identify all indices in an array that are within k distance of elements equal to the given key using two-pointer scannin…

Easy
2234

Maximum Total Beauty of the Gardens

Determine the maximum total beauty of gardens by strategically planting flowers using binary search over achievable flow…

Hard
2300

Successful Pairs of Spells and Potions

Count how many potions pair successfully with each spell using binary search over sorted potion strengths efficiently.

Medium
2332

The Latest Time to Catch a Bus

Find the latest time to catch a bus based on departure times, passenger arrivals, and capacity using binary search over …

Medium
2337

Move Pieces to Obtain a String

Determine if the pieces in start can be moved to form target using two-pointer scanning and strict left-right movement r…

Medium
2367

Number of Arithmetic Triplets

Count the number of arithmetic triplets in a given strictly increasing array with a specified difference.

Easy
2396

Strictly Palindromic Number

Determine if a number is strictly palindromic in all bases from 2 to n minus 2 using two-pointer scanning and invariant …

Medium
2406

Divide Intervals Into Minimum Number of Groups

Determine the minimum number of non-overlapping groups for a set of intervals using precise two-pointer scanning logic.

Medium
2410

Maximum Matching of Players With Trainers

Maximize the number of valid player-trainer matchings using two-pointer scanning and careful sorting strategy.

Medium
2441

Largest Positive Integer That Exists With Its Negative

Find the largest positive integer in an array such that its negative counterpart also exists.

Easy
2460

Apply Operations to an Array

Transform an array by applying adjacent doubling operations and shifting zeros efficiently using two-pointer scanning te…

Easy
2462

Total Cost to Hire K Workers

Optimize the total cost of hiring exactly k workers using a two-pointer approach with invariant tracking and priority qu…

Medium
2465

Number of Distinct Averages

Calculate the number of unique averages formed by repeatedly pairing smallest and largest elements efficiently using has…

Easy
2472

Maximum Number of Non-overlapping Palindrome Substrings

Find the maximum number of non-overlapping palindromic substrings of at least length k in a string using dynamic program…

Hard
2486

Append Characters to String to Make Subsequence

Determine the minimum characters to append to s so t becomes a subsequence using efficient two-pointer scanning techniqu…

Medium
2491

Divide Players Into Teams of Equal Skill

Divide players into equal skill teams and return the sum of their chemistry, or -1 if impossible.

Medium
2503

Maximum Number of Points From Grid Queries

Solve the Maximum Number of Points From Grid Queries problem using two-pointer scanning and invariant tracking.

Hard
2511

Maximum Enemy Forts That Can Be Captured

Find the maximum number of enemy forts that can be captured by moving your army using two-pointer scanning with invarian…

Easy
2540

Minimum Common Value

Find the smallest integer appearing in both sorted arrays efficiently using array scanning and hash-based lookup techniq…

Easy
2562

Find the Array Concatenation Value

Compute the array concatenation value efficiently using two-pointer scanning while maintaining a running total of concat…

Easy
2563

Count the Number of Fair Pairs

Efficiently count all fair pairs in an array using sorting and binary search, focusing on the sum range between lower an…

Medium
2565

Subsequence With the Minimum Score

Find the minimum score of a string by removing characters from t while maintaining subsequence validity with s.

Hard
2570

Merge Two 2D Arrays by Summing Values

Merge two 2D arrays by summing values with matching ids using array scanning and hash lookup efficiently.

Easy
2576

Find the Maximum Number of Marked Indices

Maximize marked indices in an array by performing allowed operations, applying binary search to find the optimal count e…

Medium
2592

Maximize Greatness of an Array

Maximize Greatness of an Array requires permuting numbers to exceed original values at most indices efficiently.

Medium
2697

Lexicographically Smallest Palindrome

Given a string, make it a palindrome with the fewest operations, prioritizing lexicographically smallest result.

Easy
2824

Count Pairs Whose Sum is Less than Target

This problem asks you to count all index pairs in an array whose sum is strictly less than a given target value efficien…

Easy
2825

Make String a Subsequence Using Cyclic Increments

Determine if str2 can be made a subsequence of str1 by incrementing characters cyclically using at most one operation.

Medium
2856

Minimum Array Length After Pair Removals

This problem involves minimizing the length of a sorted array by repeatedly removing adjacent pairs of equal elements.

Medium
2903

Find Indices With Index and Value Difference I

Find two indices in an array where their difference in both index and value meets specified thresholds.

Easy
2905

Find Indices With Index and Value Difference II

Locate two indices in an array where both index and value differences meet specified thresholds using precise scanning t…

Medium
2911

Minimum Changes to Make K Semi-palindromes

Minimize the number of letter changes to partition a string into k semi-palindromes using dynamic programming and two po…

Hard
2938

Separate Black and White Balls

Solve the "Separate Black and White Balls" problem by swapping adjacent balls to group all black balls to the right with…

Medium
2970

Count the Number of Incremovable Subarrays I

Count the number of incremovable subarrays in an array by removing them to create a strictly increasing sequence.

Easy
2972

Count the Number of Incremovable Subarrays II

Count the number of incremovable subarrays where removal of the subarray results in a strictly increasing array.

Hard
3006

Find Beautiful Indices in the Given Array I

Identify all beautiful indices where substring a appears and a nearby substring b exists within distance k efficiently.

Medium
3008

Find Beautiful Indices in the Given Array II

Find Beautiful Indices in the Given Array II challenges you to use binary search and string matching techniques.

Hard
3132

Find the Integer Added to Array II

Given two arrays nums1 and nums2, determine the integer added to nums1 to make it equal to nums2 after removing two elem…

Medium
3186

Maximum Total Damage With Spell Casting

Calculate the maximum total damage by selectively casting spells while avoiding adjacent power conflicts using array sca…

Medium
3194

Minimum Average of Smallest and Largest Elements

Solve the Minimum Average of Smallest and Largest Elements problem using two-pointer scanning to track averages effectiv…

Easy
3239

Minimum Number of Flips to Make Binary Grid Palindromic I

Find the minimum flips to make a binary grid palindromic by scanning with two pointers and tracking symmetry efficiently…

Medium
3240

Minimum Number of Flips to Make Binary Grid Palindromic II

The problem asks to flip cells in a binary grid to make its rows and columns palindromic using the minimum number of fli…

Medium
3302

Find the Lexicographically Smallest Valid Sequence

Determine the lexicographically smallest valid index sequence by using state transition dynamic programming over word1 a…

Medium
3316

Find Maximum Removals From Source String

Determine the maximum number of characters you can remove from source while keeping pattern as a subsequence using array…

Medium
3403

Find the Lexicographically Largest String From the Box I

This problem involves finding the lexicographically largest string from a given word using a two-pointer approach.

Medium
3455

Shortest Matching Substring

Find the shortest substring in a string that matches a pattern with exactly two wildcards efficiently using binary searc…

Hard
3503

Longest Palindrome After Substring Concatenation I

Compute the maximum palindrome length by concatenating substrings from two strings using state transition dynamic progra…

Medium
3504

Longest Palindrome After Substring Concatenation II

Compute the longest palindrome by concatenating substrings from two strings using state transition dynamic programming e…

Hard
3584

Maximum Product of First and Last Elements of a Subsequence

Maximize the product of the first and last elements of any subsequence of size m in an integer array.

Medium

Related Patterns

Two Pointers LeetCode Problems: 182 Solutions