## Elements to be added so that all elements of a range are present in array

Given an array of size N. Let A and B be the minimum and maximum in the array respectively. Task is to find how many… Read More »

Given an array of size N. Let A and B be the minimum and maximum in the array respectively. Task is to find how many… Read More »

We are given an array a consisting of n integers and an integer k. We need to find minimum range in array [l, r] (both… Read More »

Given an array of size n. The task is to find the longest subsequence such that difference between adjacents is one. Time Complexity of O(n)… Read More »

Given an array of n integers and q queries, print the number of next greater elements to the right of the given index element. Examples:… Read More »

Given an array of size n containing 0’s and 1’s only. The problem is to find the length of the longest subarray having count of… Read More »

There are many points in two-dimensional space which need to be visited in a specific sequence. Path from one point to other is always chosen… Read More »

Given a limited range array contains both positive and non positive numbers, i.e., elements are in range from -MAX to +MAX. Our task is to… Read More »

Given an unsorted array. The task is to calculate the cumulative frequency of each element of the array using count array. Examples: Input : arr[]… Read More »

Given a binary string. We need to find the length of longest balanced sub string. A sub string is balanced if it contains equal number… Read More »

Given an array, for each element find the value of nearest element to the right which is having frequency greater than as that of current… Read More »

We have introduced Graph implementation using array of vectors in Graph implementation using STL for competitive programming | Set 1. In this post, a different… Read More »

Given an array of distinct integers, print all the pairs having positive value and negative value of a number that exists in the array. We… Read More »

Given two sequences, one is increasing sequence a[] and another a normal sequence b[], find the K-th missing element in the increasing sequence which is… Read More »

Print the shortest sub-string of a string containing all the given words. In the first example, two solutions are possible: “world is here. this is… Read More »

Prerequisite – Hashing Introduction, Implementing our Own Hash Table with Separate Chaining in Java In Open Addressing, all elements are stored in the hash table… Read More »