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 →
Given a weighted directed graph consisting of N nodes and M edges, the task is to find the first K shortest distances between two nodes A and B. (Assuming there are k Read more →
Given an array of positive integers, find the maximum product difference. The product difference between the two pairs is defined as taking the product of two pairs, followed by taking their difference. Read more →
You are given an binary array (i.e., containing 0 and 1 as a element). Here, 0 means a straight path and 1 means zigzag path. Add one to score when zero appears Read more →
Given an array of N size denotes number of students and element of array denotes marks of students. Marks belongs between 1 to 100, where A[i] is less or equal to 32 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 infinite stream of integers, find the k’th largest element at any point of time. It may be assumed that 1 <= k <= n. Example: Input: stream[] = {10, 20, Read more →