## Subarray whose sum is closest to K

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 »

## Smallest Greater Element on Right Side

Given an array of distinct elements, print the closest greater element for every element. The closest greater element for an element x is the smallest… Read More »

## Queries to insert, delete one occurrence of a number and print the least and most frequent element

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 »

## set cbegin() and cend() function in C++ STL

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 »

## set crbegin() and crend() function in C++ STL

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 »

## set count() function in C++ STL

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 »

## set max_size() function in C++ STL

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 »

## set emplace_hint() function in C++ STL

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 »

## set upper_bound() function in C++ STL

The set::upper_bound() is a built-in function in C++ STL which returns an iterator pointing to the immediate next element which is just greater than k.… Read More »

## set lower_bound() function in C++ STL

The set::lower_bound() is a built-in function in C++ STL which returns an iterator pointing to the element in the container which is equivalent to k… Read More »

## set find() function in C++ STL

The set::find is a built-in function in C++ STL which returns an iterator to the element which is searched in the set container. If the… Read More »

## set insert() function in C++ STL

The set::insert is a built-in function in C++ STL which insert elements in the set container or inserts the elements from a position to another… Read More »

## set equal_range() function in C++ STL

The set::equal_range() is a built-in function in C++ STL which returns an iterator of pairs. The pair refers to the range that includes all the… Read More »

## Print all distinct circular strings of length M in lexicographical order

Given a string and an integer M, print all distinct circular strings of length M in lexicographical order. Examples: Input: str = “baaaa”, M =… Read More »

## Print all distinct integers that can be formed by K numbers from a given array of N numbers

Given an array of N elements and an integer K, print all the distinct integers which can be formed by choosing K numbers from the… Read More »