## 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 »

- Kth smallest element in a subarray
- Find the smallest positive number missing from an unsorted array | Set 3
- Remove duplicates from unsorted array using Set data structure
- Pair with largest sum which is less than K in the array
- Find the minimum number of moves to reach end of the array
- Sum of digits with even number of 1's in their binary representation
- Minimum number of Fibonacci jumps to reach end
- Calculate height of Binary Tree using Inorder and Level Order Traversal
- Reduce number to a single digit by subtracting adjacent digits repeatedly
- Count smaller elements on right side and greater elements on left side using Binary Index Tree
- Find sum of a[i]%a[j] for all valid pairs
- Find minimum changes required in an array for it to contain k distinct elements
- Maximum subsequence sum such that all elements are K distance apart
- Make the list non-decreasing by changing only one digit of the elements
- Queries for number of distinct elements in a subarray | Set 2
- Sort an array of strings according to string lengths using Map
- Count of triplets that satisfy the given equation
- Quadruplet pair with XOR zero in the given Array
- Number of Subsequences with Even and Odd Sum
- Find number of triplets in array such that a[i]>a[j]>a[k] and i<j<k
- Recursive program to find all Indices of a Number
- Find the sum of all possible pairs in an array of N elements
- Find the winner of the match | Multiple Queries
- Find subarray with given sum with negatives allowed in constant space
- Sum of the sums of all possible subsets
- Smallest element greater than X not present in the array
- Minimum Bitwise XOR operations to make any two array elements equal
- Minimum number of Bottles visible when a bottle can be enclosed inside another Bottle
- Optimal Strategy for a Game | Set 3
- Subsequence X of length K such that gcd(X[0], X[1]) + (X[2], X[3]) + ... is maximized

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »