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

## Find the maximum amount that can be collected by selling movie tickets

Given an integer N and an array seats[] where N is the number of people standing in a line to buy a movie ticket and… Read More »

## Queries to find the left-most given type integer in a binary array

Given a binary array arr[], the task is to design a data structure that supports the following operations in O(1). Type 1: Remove and print… Read More »

## XOR of K smallest prime and composite numbers from the given array

Given an array arr[] of N non-zero positive integers and an integer K, the task is to find the XOR of the K largest prime… Read More »

## Maximise the number of toys that can be purchased with amount K using min Heap

Given an array arr[] consisting of the cost of toys and an integer K depicting the amount of money available to purchase toys. The task… Read More »

## Minimum operations required to make every element greater than or equal to K

Given an array of length N. The task is to convert it into a sequence in which all elements are greater than or equal to… Read More »

## Rearrange numbers in an array such that no two adjacent numbers are same

Given an array of integers. The task is to rearrange elements of the array such that no two adjacent elements in the array are same.… Read More »

## Maximum possible sub-array sum after at most X swaps

Given an array arr[] of N integers and an integer X, the task is to find the maximum possible sub-array sum after applying at most… Read More »

## Reduce the array to a single integer with the given operation

Given an array arr[] of N integers from 1 to N. The task is to perform the following operations N – 1 times. Select two… Read More »

## Print the final string when minimum value strings get concatenated in every operation

Given an array of strings and an array of integers where ith integer of the array corresponds to the value of the ith string present… Read More »

## Shortest path from source to destination such that edge weights along path are alternatively increasing and decreasing

Given a connected graph with N vertices and M edges. The task is to find the shortest path from source to the destination vertex such… Read More »

## Minimize the sum calculated by repeatedly removing any two elements and inserting their sum to the Array

Given N elements, you can remove any two elements from the list, note their sum and add the sum to the list. Repeat these steps… Read More »

## Print the lexicographically smallest BFS of the graph starting from 1

Given a connected graph with N vertices and M edges. The task is to print the lexicographically smallest BFS traversal of the graph starting from… Read More »

## Maximum number of leaf nodes that can be visited within the given budget

Given a binary tree and an integer b representing budget. The task is to find the count of maximum number of leaf nodes that can… Read More »

## K-th Greatest Element in a Max-Heap

Given a max-heap of size n, find the kth greatest element in the max-heap. Examples: Input : maxHeap = {20, 15, 18, 8, 10, 5,… Read More »