## Minimum possible sum of array B such that AiBi = AjBj for all 1 ≤ i < j ≤ N

Given an array a[] of size N. The task is to find the minimum possible sum of the elements of array b[] such that a[i]… Read More »

## Queries to check whether bitwise AND of a subarray is even or odd

Given an array arr[] of N positive integers, the task is to answer Q queries where each query consists of a range [L, R] and… Read More »

## Find distinct integers for a triplet with given product

Given an integer X, the task is to find the three distinct integers greater than 1 i.e. A, B and C such that (A *… Read More »

## Maximum profit by selling N items at two markets

Given two array A[] and B[] each of length N where A[i] and B[i] are the prices of the ith item when sold in market… Read More »

## Find an array of size N that satisfies the given conditions

Given three integers N, S and K, the task is to create an array of N positive integers such that the bitwise OR of any… Read More »

## Search an element in a sorted and rotated array with duplicates

Given an array arr[] which is sorted and rotated, the task is to find an element in the rotated array (with duplicates) in O(log n)… Read More »

## Check if Sum and XOR of all elements of array is equal

Given an array arr[], the task is to check if sum of all elements of an array is equal to XOR of all elements of… Read More »

## Find all the possible mappings of characters in a sorted order

Given a number find all the possible mappings of the characters in sorted order. Examples: Input: 123 Output: ABC AW LC Explanation: 1 = A;… Read More »

## Arrange numbers to form a valid sequence

Given an array arr[] with N distinct numbers and another array arr1[] with N-1 operators (either < or >), the task is to organize the… Read More »

## Count the subarray with sum strictly greater than the sum of remaining elements

Given an array arr[] of N positive integers, the task is to count all the subarrays where the sum of subarray elements is strictly greater… Read More »

## Count of odd length contiguous Palindromic sequences in a Matrix

Given a matrix arr[][] of size MxN, the task is to find the number of contiguous palindromic sequences of odd length in that matrix. Example:… Read More »

## Making all elements of matrix equal to a given element K

Given a 2-d array arr[][], the task is to check whether it is possible to make all elements of the array to equal to a… Read More »

## Find the maximum range [L,R] whose sum is divisible by M

Given an array arr[] consisting of positive numbers, the task is to find the maximum range [L, R] whose sum is divisible by M. If… Read More »

## Count of even and odd power pairs in an Array

Given an array arr[] of length N, the task is to count the number of pairs (X, Y) such that XY is even and count… Read More »

## Number of pairs of arrays (A, B) such that A is ascending, B is descending and A[i] ≤ B[i]

Given two integers N and M, the task is to find the number of pairs of arrays (A, B) such that array A and B… Read More »