## De-arrangements for minimum product sum of two arrays

Given two arrays A[] and B[] of same size n. We need to first permute any of arrays such that the sum of product of… Read More »

Given two arrays A[] and B[] of same size n. We need to first permute any of arrays such that the sum of product of… Read More »

Given a string str and a character x, find last index of x in str. Examples : Input : str = “geeks”, x = ‘e’… Read More »

Given an array of n positive elements, find the maximum AND value and the pair of elements generating the maximum AND value from the array.… Read More »

Given an array of N integers, You have to find the probability of choosing a random pair(i, j), i < j such that A[i] +… Read More »

Given a array if ‘n’ positive integers. Count number of pairs of integers in the array that have the sum divisible by 4. Input: {2,… Read More »

Given three distinct numbers a, b and c find the number with a value in middle. Examples : Input : a = 20, b =… Read More »

We are given an array of m-elements, we need to find n smallest elements from the array but they must be in the same order… Read More »

Given three positive integers X, Y and P. Here P denotes the number of turns. Whenever the turn is odd X is multiplied by 2… Read More »

We have to paint n boards of length {A1, A2, .. An}. There are k painters available and each takes 1 unit time to paint… Read More »

Given two arrays, the task is to calculate the product of max element of first array and min element of second array References : Asked… Read More »

People in a group, are sitting in a row numbered from 1 to n. Every has been asked the same question, “How many people of… Read More »

Given an array of n-elements. Given array is a permutation of some Arithmetic Progression. Find the minimum number of De-arrangements present in that array so… Read More »

Given an array, write functions to find minimum and maximum elements in it. Output: Minimum element of array: 1 Maximum element of array: 1234 Time… Read More »

Given an array and two numbers x and k. Find the number of different ordered pairs of indexes (i, j) such that a[j] >= a[i]… Read More »

Given two arrays A and B, a random pair is picked having an element from array A and another from array B. Output the probability… Read More »