Given an unsorted array of integers which may contain repeated elements, sort the elements in ascending order of sum of its occurrence and print only distinct elements. If there exist more than Read more →
Latest tutorials
505 postsGiven two array A[] and B[] of length N, the task is the find the minimum cost to make array A[] a permutation of array B[], where the cost of incrementing or Read more →
Given an array of n integers, you need to find minimum number of below operation such that arrays becomes sorted in non-decreasing order. In a single operation you can rotate the given Read more →
Given an array of integers, A[] of size n with elements in range 1 to n may not consist of all the numbers from 1 to n. There are two players P1 Read more →
Given a string S of size N, the task is to sort the string without changing the place of vowels. Examples: Input: S = "example" Output: elampxe Explanation: The consonants are xmpl. Read more →
Given an array arr[] of size N (0 < arr[i] < 106), the task is to find the total count of pairs such that by dividing the largest number by the smallest Read more →
Given a binary string consisting of ‘0’ & ‘1’. You can remove any subsequence in given string but can’t pick adjacent indices. Print “POSSIBLE” if string can be sorted else print “NOTPOSSIBLE”. Read more →
Given two arrays a and b of the same size. Find the count of total pair in array a, such that the sum of elements of pair of array a is greater Read more →
N objects are placed on X-axis, and coordinates are given. Starting your journey with coordinate 0, find minimum distance you need to travel to collect K objects (If multiple objects are placed Read more →
Given an array of integers, in one operation a length x ( x >= 1 && x < n) can be chosen and the prefix of x length is sorted and then Read more →