# Tag Archives: two-pointer-algorithm

Given a string S which consists of only lowercase English alphabets, the task is to remove the first repeating character, reverse it, and repeat untilâ€¦ Read More
Given an array, arr[] and integer X. Find all the possible triplets from an arr[]  whose sum is either equal to less than X. Example:â€¦ Read More
Given an array a[] of 2*N integers, The task is to make the array a[] of size N i.e, reducing it to half size suchâ€¦ Read More
Given an array of positive elements arr[] of length N, the task is to count all the subarrays such that the product of the subarrayâ€¦ Read More
Given a string S of size N and a positive integer K. The given string only consists of the first K English lowercase alphabets. Theâ€¦ Read More
Given an array arr[] of size N and a non-negative integer K, the task is to find the length of the longest subsequence such thatâ€¦ Read More
Given two arrays A[] and B[] of size N each, the task is to find the number of elements in array B[] that occur beforeâ€¦ Read More
Given an array arr[] of N Positive integers, the task is to find the largest prefix sum which is also the suffix sum and prefixâ€¦ Read More
Given an array arr[] of size N, the task is to print the lexicographically next greater permutation of the given array. If there does notâ€¦ Read More
Given an integer array arr[] of size N that is sorted in increasing order and an integer K, Return an array with power of Kâ€¦ Read More
Given a binary array a[] or size N and an integer K, the task is to find the longest subarray consisting of only 1s orâ€¦ Read More
Given an array arr[] of size N, the task is to find the minimum difference between the maximum and the minimum subarray sum when theâ€¦ Read More
Given an integer array arr of size N[], the task is to find the longest equilibrium subarray i.e. a subarray such that the prefix sumâ€¦ Read More
Given a stack of M elements and a queue of N elements in sorted order. The task is to find out the common elements ofâ€¦ Read More
Given a string S of size N consisting of the characters 0, 1 and 2, the task is to find the length of the smallestâ€¦ Read More