## Maximize the profit after selling the tickets

Given an array seats[] where seat[i] is the number of vacant seats in the ith row in a stadium for a cricket match. There are… Read More »

## Largest number dividing maximum number of elements in the array

Given an array arr[] of length N, the task is to find the largest number dividing the maximum number of elements from the array. Examples:… Read More »

## Knapsack with large Weights

Given a knapsack with capacity C and two arrays w[] and val[] representing the weights and values of N distinct items, the task is to… Read More »

## Remove all the prime numbers from the given array

Given an array arr[] of N integers, the task is to remove all the prime numbers. Examples: Input: arr[] = {4, 6, 5, 3, 8,… Read More »

## Remove one element to get minimum OR value

Given an array arr[] of N elements, the task is to remove one element from the array such that the OR value of the array… Read More »

## Perform append, update, delete and range sum queries on the given array

Given an array arr[] of size N and the task is to answer Q queries of the following types: 1 X 0: Append X at… Read More »

## Value to be subtracted from array elements to make sum of all elements equals K

Given an integer K and an array height[] where height[i] denotes the height of the ith tree in a forest. The task is to make… Read More »

## Count of subarrays having exactly K distinct elements

Given an array arr[] of size N and an integer K. The task is to find the count of subarrays such that each subarray has… Read More »

## Count ways to reach the Nth stair using any step from the given array

Given N stairs and a person standing at the bottom wants to reach the top. He could climb any number of steps from the given… Read More »

## Count subarrays such that remainder after dividing sum of elements by K gives count of elements

Given an array arr[] of size N and an element K. The task is to find the number of sub-arrays of the given array such… Read More »

## Place the prisoners into cells to maximize the minimum difference between any two

Given an array cell[] of N elements, which represent the positions of the cells in a prison. Also, given an integer P which is the… Read More »

## Maximum sum of two elements whose digit sum is equal

Given an array arr[] of N positive elements, the task is to find a pair in the array such that the digit sum of elements… Read More »

## Check if given string contains all the digits

Given a string str consisting of alphanumeric characters, the task is to check whether the string contains all the digits from 1 to 9. Examples:… Read More »

## Find the final number obtained after performing the given operation

Given an array of positive distinct integers arr[], the task is to find the final number obtained by performing the following operation on the elements… Read More »

## Maximum sum combination from the given array

Given an array arr[] of N integers and three integers X, Y and Z. The task is to find the maximum value of (arr[i] *… Read More »