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 →
Arrays
106 postsGiven 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 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 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 →
You have a Restaurant and there is a Array nums [ ] of N people outside your restaurant. Your, waiter found out that for each valid i, the i-th person gave Ai 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 →
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 →