## Check if given Sudoku board configuration is valid or not

Given a Sudoku Board configuration, check whether it is valid or not. Examples: Input: [5 3 – – 7 – – – -] [6 -… Read More »

Given a Sudoku Board configuration, check whether it is valid or not. Examples: Input: [5 3 – – 7 – – – -] [6 -… Read More »

set::rbegin() is a built-in function in C++ STL which returns a reverse iterator pointing to the last element in the container. Syntax: reverse_iterator set_name.rbegin() Parameters:… Read More »

Suppose there are n towns connected by m bidirectional roads. There are s towns among them with a police station. We want to find out… Read More »

Pre-requisite : set in C++, unordered_set in C++ Differences : | set | unordered_set ——————————————————— Ordering | increasing order | no ordering | (by default)… Read More »

set and map in STL are similar in the sense that they both use Red Black Tree (A self balancing BST). Note that the time… Read More »

Prerequisite :Basic knowledge of STL and Sets Data structure. About ordered set Ordered set is a policy based data structure in g++ that keeps the… Read More »

Write a function to count number of smaller elements on right of each element in an array. Given an unsorted array arr[] of distinct integers,… Read More »

Given a set of N elements such that N, task is to generate an array such that the GCD of any subset of the generated… Read More »

Given an array of elements, task is to sort these elements using stack. Prerequisites : Stacks Examples : Input : 8 5 7 1 9… Read More »

Given two integers L and R. Find the number of perfect powers in the given range [L, R]. A number x is said to be… Read More »

The C++ STL set is a data structure used to store the distinct value in ascending or descending order. By default, we can use it… Read More »

Given an array that might contain duplicates, print all distinct elements in sorted order. Examples: Input : 1, 3, 2, 2, 1 Output : 1… Read More »

An array is given of n length, and we need to calculate the next greater element for each element in given array. If next greater… Read More »

Given a Binary Tree, convert it to a Binary Search Tree. The conversion must be done in such a way that keeps the original structure… Read More »

Assign value by a pair of {} to a container As we are familiar with the pair there is also one thing known as tuples.… Read More »