Generate an array of K elements such that sum of elements is N and the condition a[i] < a[i+1] <= 2*a[i] is met | Set 2

Given two integers N and K, the task is to generate an array arr[] of length K such that: arr + arr + … +… Read More »

Maximum number that can be display on Seven Segment Display using N segments

Given a positive integer N. The task is to find the maximum number that can be displayed on seven segment display using N segments. Seven… Read More »

Generate an array of size K which satisfies the given conditions

Given two integers N and K, the task is to generate an array arr[] of length K such that: arr + arr + … +… Read More »

Check if it is possible to make two martices strictly increasing by swapping corresponding values only

Given two n * m matrices A[][] and B[][], the task is to make both the matrices strictly increasing (both rows and columns) only by… Read More »

Minimum number of given operations required to reduce the array to 0 element

Given an array arr[] of N integers. The task is to find the minimum number of given operations required to reduce the array to 0… Read More »

Smallest multiple of N formed using the given set of digits

Given a set of digits S and an integer N, the task is to find the smallest positive integer if exists which contains only the… Read More »

Count number of subsets whose median is also present in the same subset

Given an array arr[] of size N, the task is to count the number of ways we can select a subset from the given array… Read More »

Maximize the given number by replacing a segment of digits with the alternate digits given

Given a large number of N digits. We are also given with 10 numbers which represents the alternate number for all the one-digit numbers from… Read More »

Minimizing array sum by applying XOR operation on all elements of the array

Given an array arr[] of N integer elements, the task is to choose an element X and apply XOR operation on every element of the… Read More »

Maximum money that can be withdrawn in two steps

There are two cash lockers, one has X number of coins and the other has Y number of coins, you can withdraw money at max… Read More »

Find the minimum of maximum length of a jump required to reach the last island in exactly k jumps

Given an array arr[] of integers, where the ith integer represents the position where an island is present, and an integer k (1 ≤ k… Read More »

Minimum value of X to make all array elements equal by either decreasing or increasing by X

Given an array of N elements and you can perform two operations on it: Increase any of the array element by X once. Decrease any… Read More »

Maximum elements which can be crossed using given units of a and b

Given a binary array of N elements and two initial values a and b. We can cross the i-th element if: If a[i] == 0,… Read More »

Largest number not greater than N which can become prime after rearranging its digits

Given a number N, the task is to find the largest number less than or equal to the given number N such that on rearranging… Read More »

Move all zeros to start and ones to end in an Array of random integers

Given an array arr[] of random integers, the task is to push all the zero’s in the array to the start and all the one’s… Read More »