Skip to content

Category Archives: Sorting

Given an array arr[] containing N positive integers, the task is to maximize the array sum when after every sum operation all the remaining array… Read More
Given an array of pairs arr[] of size N where the first value of all the pairs are distinct. For each pair of the given… Read More
Given an arr[ ] of size N, containing positive, negative integers and one zero. The task is to rearrange the array in such a way… Read More
Given an array arr[] of N integers, the task is to replace each element of Array with their rank according to Rightmost-Set Bit (RSB) in… Read More
Given an array arr[] of N integer pairs and an integer K, the task is to find the indices of the K largest pairs in… Read More
Given a sentence S of size N where each word is a concatenation of a numeric part followed by a bunch of characters. The task… Read More
Given an array arr[] of size N and an integer K. The task is to find the Kth largest element from the right of every… Read More
Given an array arr[]. The task is to divide arr[] into the maximum number of partitions, such that, those partitions if sorted individually make the… Read More
Given an array a[] of positive integers. Subtract any positive integer from any number of elements of the array such that there exists every possible… Read More
Given an array arr[] of size N. The task is to find the number of sequences in which any one of the following conditions is… Read More
Given an array arr[] of size N and integer K, the task is to maximize the sum of the array by performing the following operations… Read More
Given an array, arr[] of size N and an integer K. If a value in arr[] is less than or equal to K, then that… Read More
Given an array, arr[] of size N., The task is to perform minimum increment or decrement operations on the elements of the array, to make… Read More
Given an array of positive integer arr[], and a number K. the task is to maximize the sum of the array by replacing any K… Read More
Given an array arr[] of N positive numbers and an integer M. The task is to maximize the value of M by adding array elements… Read More