Tutorials
Courses
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
Mathematical
7.7K+ articles
Arrays
6.4K+ articles
Strings
3.2K+ articles
Competitive Programming
3.2K+ articles
Greedy
2.1K+ articles
Sorting
1.8K+ articles
Searching
1.7K+ articles
subarray
658+ articles
two-pointer-algorithm
213+ posts
Recent Articles
Popular Articles
Two-Pointer Technique in a Linked List
Last Updated: 04 March 2024
The two-pointer technique is a common technique used in linked list problems to solve a variety of problems efficiently. It involves using two pointers that traverse the l...
read more
Linked List
Data Structures
DSA
Linked Lists
two-pointer-algorithm
Data Structures and Algorithms-QnA
CSES Solutions - Sum of Four Values
Last Updated: 30 July 2024
You are given an array arr[] of N integers, and your task is to find four values (at distinct positions) whose sum is X. Note: If there are multiple answers, print any one...
read more
Sorting
Competitive Programming
Picked
DSA
two-pointer-algorithm
CSES Problems
CSES Solutions - Sum of Three Values
Last Updated: 28 March 2024
You are given an array arr[] of N integers, and your task is to find three values (at distinct positions) whose sum is X. Note: The indices can be printed in any order.Exa...
read more
Sorting
Competitive Programming
Picked
DSA
two-pointer-algorithm
CSES Problems
Put Maximum Number of Boxes Into the Warehouse II
Last Updated: 23 April 2024
You are given two arrays of positive integers, boxes[] and warehouse[]. The boxes array represents the heights of some boxes of unit width, and the warehouse array represe...
read more
Greedy
Picked
DSA
Arrays
Google
two-pointer-algorithm
Two Sum - Pair sum in sorted array
Last Updated: 26 September 2024
Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these t...
read more
Picked
DSA
Arrays
two-pointer-algorithm
Apple
Count number of times given sentence can be fitted on screen
Last Updated: 11 June 2024
Given a screen with dimensions rows*cols, and a sentence represented as a list of strings. The task is to return the number of times the given sentence can be fitted on th...
read more
Strings
Picked
DSA
Google
two-pointer-algorithm
Interview-Questions
Remove All Occurrences of an Element in an Array
Last Updated: 09 November 2024
Given an integer array arr[] and an integer ele the task is to the remove all occurrences of ele from arr[] in-place and return the number of elements which are not equal ...
read more
Picked
DSA
Arrays
two-pointer-algorithm
Interview-Questions
Minimum boats to save people
Last Updated: 12 June 2024
Given an array people[] where people[i] is the weight of the ith person, and an infinite number of boats where each boat can carry at most two people at a time with total ...
read more
Sorting
Picked
DSA
Intuit
two-pointer-algorithm
Interview-Questions
2Sum - Complete Tutorial
Last Updated: 22 February 2025
The 2-Sum problem is a popular algorithmic challenge where the goal is to identify two distinct elements in an array whose sum equals a specific target. The problem emphas...
read more
Algorithms
DSA
Hash
two-pointer-algorithm
3Sum - Complete Tutorial
Last Updated: 22 February 2025
The 3-Sum problem is a classic algorithmic problem where the objective is to find all unique triplets in an array that sum up to a specific target value, usually zero. Thi...
read more
Algorithms
DSA
two-pointer-algorithm
3Sum
2 Sum - Pair Sum Closest to Target
Last Updated: 28 December 2024
Given an array arr[] of n integers and an integer target, the task is to find a pair in arr[] such that it’s sum is closest to target.Note:Return the pair in sorted order ...
read more
Algorithms
Searching
Sorting
DSA
Arrays
two-pointer-algorithm
4 Sum - Quadruplet Sum Closest to Target
Last Updated: 15 October 2024
Given an array arr[] of n integers and an integer target, the task is to find a quadruplet in arr[] whose sum is closest to target.Note: There may be multiple quadruplets ...
read more
Searching
DSA
Arrays
two-pointer-algorithm
4 Sum - Find any quadruplet having given sum
Last Updated: 07 October 2024
Given an array arr[] of n integers and an integer target, the task is to find any quadruplet in arr[] such that it's sum is equal to the target. Note: If there are multipl...
read more
Searching
DSA
Arrays
two-pointer-algorithm
3 Sum - Count Triplets With Given Sum In Sorted Array
Last Updated: 10 February 2025
Given a sorted arrayarr[]and a target value, the task is to find the count of triplets present in the given array having sum equal to the given target.More specifically, t...
read more
DSA
Arrays
two-pointer-algorithm
3Sum
Top Problems on Two Pointers Technique for Interviews
Last Updated: 16 May 2025
The Two Pointer Approach is a powerful and efficient technique used to solve problems involving sorted arrays, searching, and optimization. By utilizing two pointers eithe...
read more
DSA
two-pointer-algorithm
1
2
3
4
...
15
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !