## Longest subarray with only one value greater than k

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 of pairs in C++
- 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
- Print Minimum of all Subarrays using set in C++ STL
- Maximum value of XOR among all triplets of an array
- Count triplet pairs (A, B, C) of points in 2-D space that satisfy the given condition
- Smallest Greater (than S) String of length K whose letters are subset of S
- Longest subarray with only one value greater than k
- Count pairs from two arrays whose modulo operation yields K
- Print all integers that are sum of powers of two given numbers
- set operator= in C++ STL
- How to traverse a C++ set in reverse direction
- set get_allocator() in C++ STL
- Minimum Numbers of cells that are connected with the smallest path between 3 given cells
- How to delete an element from the Set by passing its value in C++
- Minimum array elements to be changed to make it a Lucas Sequence
- How to delete a range of values from the Set using Iterator

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 »

The set::cbegin() is a built-in function in C++ STL which returns a constant iterator pointing to the first element in the container. The iterator cannot… Read More »

The set::crbegin() is a built-in function in C++ STL which returns a constant iterator pointing to the last element in the container. The iterator cannot… Read More »

The set::count() is a built-in function in C++ STL which returns the number of times an element occurs in the set. It can only return… Read More »

The set::max_size() is a built-in function in C++ STL which returns the maximum number of elements a set container can hold. Syntax: set_name.max_size() Parameters: This… Read More »

The set::emplace_hint() is a built-in function in C++ STL which inserts a new element in the set. A position is passed in the parameter of… Read More »