Given an array arr[] of size N, the task is to rearrange the array elements such that the count of local minima in the array… Read More

# Tag Archives: two-pointer-algorithm

Given two integer arrays arr[] and brr[] consisting of distinct elements of size N and M respectively and an integer K, the task is to… Read More

Given two integer arrays arr[] and brr[] consisting of distinct elements of size N and M respectively and an integer K, the task is to… Read More

Given an array arr[] of N positive integers with an equal number of even and odd elements. The task is to use in-place swapping to… Read More

There is a one-dimensional garden of length N. In each position of the N length garden, a fountain has been installed. Given an array a[]such… Read More

Given two arrays coins[] and salaries[] where coins[i] represents the value of ith coin and salaries[j] represents the minimum value of the coin that jth… Read More

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and… Read More

Given an array arr[], the task is to check if it is possible to rearrange the array in such a way that every even index(1-based… Read More

Given a binary string S, the task is to find the minimum number of swaps required to be performed to maximize the value represented by… Read More