## Find if k bookings possible with given arrival and departure times

A hotel manager has to process N advance bookings of rooms for the next season. His hotel has K rooms. Bookings contain an arrival date… Read More »

A hotel manager has to process N advance bookings of rooms for the next season. His hotel has K rooms. Bookings contain an arrival date… Read More »

Given an array a[] of n elements. The task is to find the array (say b[]) of n + 1 such that Greatest Common Divisor… Read More »

We are given a read only array of n integers. Find any element that appears more than n/3 times in the array in linear time… Read More »

Given an array, find the maximum difference between its two consecutive elements in its sorted form. Examples: Input : arr[] = {1, 10, 5} Output… Read More »

Given an array A[] of n elements and an integer k. The task is to find the number of triplet (x, y, k), where 0… Read More »

Given an array of positive integer and q query which contains two integers, L & R. Task is to find the number of set bits… Read More »

Given three integers x, y and z (can be negative). The task is to find the length of the smallest array that can be made… Read More »

Given two arrays among which one is almost sorted with one element being in the wrong position making the array unsorted, the task is to… Read More »

Given an array whose elements represents the coefficients of a polynomial of degree n, if the polynomial has a degree n then the array will… Read More »

Implementing priority CPU scheduling. In this problem, we are using Min Heap as the data structure for implementing priority scheduling. In this problem smaller numbers… Read More »

Given an array arr containing elements from [1…to n]. Each element appears exactly once in the array arr. Given an string str of length n-1.… Read More »

Consider an array of size n with initial 0 values. How many indices will contain value at least x after performing m range updates. In… Read More »

Given two array of size n and m. The task is to find the number of ways we can merge the given arrays into one… Read More »

Given a bracket sequence or in other words a string S of length n, consisting of characters ‘(‘ and ‘)’. Find length of the maximum… Read More »

Given an array a[1..N]. For each element at position i (1 <= i <= N). Where L(i) is defined as closest index j such that… Read More »