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 →
Sorting
25 postsGiven 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 →
Given an array Arr[ ] that consists of N distinct integers. Check that if it is possible to sort the array in ascending order by reversing a specific segment of the array. Read more →
You are given n strings. You have to print them in lexicographical increasing order. Also, ensure that all of the strings should be distinct. Examples: Input: {"Aarav", "Arjun", "Rahul", "Rishabh", "Kunal"} Output: Read more →
Given an array arr[] consisting of binary digits 0 and 1, determine the minimum number of swaps to push 0s towards one end and 1s to the other end of the array. Read more →
Given an array containing weights of gifts, and an integer representing maximum weight a box can contain. Each box carries at most 2 gifts at the same time, provided the sum of Read more →
Given an Integer Stack in Java, sort the stack in increasing order (Ascending Order) Examples: Input : Stack: [10, 2, 16, 5, 9, 1] Peek: 1 Output : Stack: [1, 2, 5, Read more →
Given an array arr[] of N non-negative integers, the task is to sort these integers according to the sum of letters required to represent them. Examples: Input: arr[] = {12, 10, 31, Read more →
Given an array arr1[] of size n, so firstly we have to reverse each element of an array, and store each of that reversed element in new arr2[] and then sort. Examples: Read more →
Given an array arr[] of N dates in the form of “dd-mm-yyyy”, the task is to sort these dates in ascending order. Examples: Input: arr[] = { "25-08-1996", "03-08-1970", "09-04-1994" } Output: Read more →