Given a string path consisting of characters ‘N’, ‘S’, ‘E’ and ‘W’ denoting 1 unit movement in North, South, East, and West directions respectively, the… Read More

# Tag Archives: cpp-set

Given an array arr[] consisting of N distinct integers, the task is to print for each array element, all the greater elements present on its… Read More

Given a set S consisting of N integers and an element K, the task is to find the index of the element K in the… Read More

The find_by_order() is a built-in function of Ordered Set which is a Policy Based Data Structure in C++. Policy-based data structures are not part of… Read More

Given an integer N and two arrays A[][], representing the set of languages a person knows, and B[][], consisting of M pairs of friendships, the… Read More

Given a matrix mat[][] of dimensions N * M, and an integer K, the task is to find the maximum sum of any rectangle possible… Read More

Given two strings S1 and S2 of lengths M and N respectively, the task is to calculate the sum of the frequencies of the characters… Read More

Given two strings A and B, the task is to count the minimum number of operations required to construct the string B by following operations: … Read More

Given an array A[] consisting of positive integers, the task is to calculate the minimum possible deviation of the given arrayA[] after performing the following… Read More

Prerequisite: Vectors in C++ STL Vectors are known as dynamic arrays with the ability to resize themselves automatically when an element is inserted or deleted,… Read More

Given an array arr[] of size N, the task is to find the smallest positive integer K such that incrementing or decrementing each array element… Read More

Given an array arr[] of size N, the task is to make all array elements equal to 0 by replacing all elements of a subsequences… Read More

Given an array arr[] of size N, the task is for each array element is to find the nearest non-equal value present on its left… Read More

Given an undirected graph G with vertices numbered in the range [0, N] and an array Edges[][] consisting of M edges, the task is to… Read More