Skip to content

# Tag Archives: two-pointer-algorithm

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
Given an array arr[] of size N, the task is to minimize the length of the given array by repeatedly removing subarrays from the start… Read More
Given a circular array arr[] of size N and an index K, the task is to reverse all elements of the circular array starting from… Read More
Given an array arr[] of size N and an integer K, the task is to find the minimum count of pairs required to be removed… Read More
Given an array arr[] of size N and an integer K, the task is to count the number of subarrays which consists of first K… Read More
Given an array arr[] of length N consisting of positive integers, the task is to find the longest increasing subsequence that can be formed by… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to find the maximum number of pairs having a sum… Read More
Given two strings X and Y of length N, the task is to check if both the strings can be made equal by reversing any… Read More
Given two strings a and b of the same length, the task is to check if splitting both the strings and concatenating their opposite substrings,… Read More
Given an array arr[] consisting of N positive integers and an integer K, the task is to minimize the difference between the maximum and minimum… Read More
Given an array arr[] of N integers and two integers S and M, the task is to maximize the minimum array element by incrementing any… Read More