## Closest greater or same value on left side for every element in array

Given an array of integers, find the closest (not considering distance, but value) greater or same value on left of every element. If an element… Read More »

- Maximum of all Subarrays of size k using set in C++ STL
- Find Maximum and Minimum element in a Set in C++ STL
- How to delete last element from a set in C++
- Closest greater or same value on left side for every element in array
- Count triplet pairs (A, B, C) of points in 2-D space that satisfy the given condition
- How to traverse a C++ set in reverse direction
- Smallest Greater (than S) String of length K whose letters are subset of S
- Count pairs from two arrays whose modulo operation yields K
- Print all integers that are sum of powers of two given numbers
- Minimum Numbers of cells that are connected with the smallest path between 3 given cells
- Find the lexicographically smallest sequence which can be formed by re-arranging elements of second array
- How to delete an element from the Set by passing its value in C++
- Greatest number less than equal to B that can be formed from the digits of A
- Total distinct pairs from two arrays such that second number can be obtained by inverting bits of first
- Distinct pairs from given arrays (a[i], b[j]) such that (a[i] + b[j]) is a Fibonacci number
- Distinct state codes that appear in a string as contiguous sub-strings
- How to delete a range of values from the Set using Iterator

Given an array of integers, find the closest (not considering distance, but value) greater or same value on left of every element. If an element… Read More »

Given an integer and two arrays and , the task is to count the total pairs (formed after choosing an element from and another from… Read More »

Given an array with N distinct elements. The task is to find the minimum number of elements to be changed in the array such that,… Read More »

Given an array of integers ‘arr’, the task is to find the maximum XOR value of any triplet pair among all the possible triplet pairs.… Read More »

Given an array of size N and an integer K, find the minimum for each and every contiguous subarray of size K. Examples: Input :… Read More »

Given an array of N numbers, find length of the longest subarray such that K is the second largest element on insertion. Examples: Input: a[]… Read More »

Sets are a type of associative containers in which each element has to be unique, because the value of the element identifies it. The value… Read More »

The set::get_allocator() in C++ STL is an in-built function which returns the copy of the allocator object associated with the set. Syntax: mulset.get_allocator(); Parameters: This… Read More »

The ‘=’ is an operator in C++ STL which copies (or moves) a set to another set and set::operator= is the corresponding operator function. There… Read More »

Given Q queries. The queries are of three types and are described below: Add the number num to the list. Remove the number num from… Read More »

Given a Bitonic sequence ‘S’ and ‘Q’ no. of queries. Each query contain an integer xi, 1 <= i <= Q. The task is to… Read More »

Given an array of positive integers(may contain duplicates) and a number ‘m’, find the number of unordered triplets ((Ai, Aj, Ak) and (Aj, Ai, Ak)… Read More »

Given an array of positive and negative integers and an integer K. The task is to find the subarray which has its sum closest to… Read More »

Given an array of distinct elements, print the Closest Greater Element (NGE) for every element. The closest greater Element for an element x is the… Read More »

Given Q queries of type 1, 2, 3 and 4 as described below. Type-1: Insert a number to the list. Type-2: Delete only one occurrence… Read More »