Given a list of n integers and consider another list which has n-1 “<” or “>” operators. Your task is to form a valid sequence by rearranging the initial list such that ...read more
We all must have encountered the vertical Traversal of the Binary Tree problem. In this version of the problem we will see how we can perform the traversal vertically while keeping in ...read more
Find maximum sum of array A, where k swap can be possible between array A and B. Size of array A and B is N. Examples: Input : N = 5 k ...read more
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
Given 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