# Tag Archives: two-pointer-algorithm

Given two arrays consisting of N distinct integers such that the array A[] and B[] are sorted in ascending and descending order respectively, the taskâ€¦ Read More
Given an array arr[] of size N consisting of 0, 1, 2, and 3 only, the task is to sort the given array in ascendingâ€¦ Read More
Given an array arr[] of size N, the task is to rearrange the array elements such that all the Prime numbers are placed before theâ€¦ Read More
Given a string S consisting of N characters and a positive integer K, the task is to count the number of substrings having at leastâ€¦ Read More
Given an array arr[] consisting of N integers, the task is to find the length of the smallest subarray required to be removed to makeâ€¦ Read More
Given a string S of length N consisting only of characters ‘a’, ‘b’, and ‘c’, the task is to minimize the length of the givenâ€¦ Read More
Given an array arr[] consisting of N integers, the task is to check if the sequence of numbers formed by repeatedly removing the middle elementsâ€¦ Read More
Given a binary string S and an array A[], both of size N, the task is to find the maximum score possible by removing substringsâ€¦ Read More
Given a Linked List and two integers X and Y, the task is to remove all occurrences of Y after the first occurrence of aâ€¦ Read More
Given an array arr[] of size N, the task is to count the number of pairs (arr[i], arr[j]) such that |arr[i]| and |arr[j]| lies betweenâ€¦ Read More
Given two sorted strings S1 and S2 of lengths N and M respectively, the task is to construct lexicographically the smallest string possible by mergingâ€¦ Read More
Given an array nums[] and an integer X, the task is to reduce X to 0 by removing either the leftmost or the rightmost arrayâ€¦ Read More
Given a singly Linked List and an integer K denoting the position of a Linked List, the task is to delete the Kth node fromâ€¦ Read More
Given a positive integer K and two arrays A[] and B[] consisting of M and N positive integers from the range [1, K] respectively, theâ€¦ Read More
Given an array arr[] consisting of N integers, the task is to print the indices of two array elements required to be removed such thatâ€¦ Read More