Given an array of positive integers you can reshuffle the array and construct a new array on which we can perform operation X on it the elements we receive must be in Read more →
Sorting
25 postsYou are given two boxes. The first box is empty while in the second, there are 3 piles of coins. Whenever you choose a pile of X coins (x>=1) from the second Read more →
Given dictionary, sort its items using key-value difference. Input : test_dict = {3 : 9, 1 : 4, 9 : 13, 1 : 10, 8 : 9 } Output : {8: 9, Read more →
Sort a list in JAVA and then return the index of elements in sorted order. Examples: Input : [2, 3, 1, 4, 5] Output : [2, 0, 1, 3, 4] After sorting Read more →
Given a number num (0 < num < 108), the task is to sort the digits of the number such that even indices are in ascending order and odd indices in descending Read more →
Given an array arr[] of 2N integers, where N is any positive integer. The task is to divide the array into N pairs such that the pair sum minimizes the maximum sum 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 →