Given an array arr[] consisting of N positive integers and an integer K, the task is to check if the array elements can be rearranged… Read More

# Tag Archives: cpp-multiset

Queries to calculate average of an array after removing K smallest and largest elements with updates

Given two positive integers N and K, initialize an empty array arr[] and Q number of queries of the following two types: addInteger(x): Insert element… Read More

Given a string S of length N, the task is to find the minimum number of characters required to be removed such that every distinct… Read More

Given two arrays A[], consisting of N integers, and B[], consisting of taste values of M chocolates and an integer X, the task is to… Read More

Given an array arr[] consisting of N positive integers and an integer K, the task is to find the minimum possible array sum that can… Read More

Given a binary string str of length N and an integer K, the task is to find the maximum possible sum of assigned weights that… Read More

Given an array arr[] of N elements, the task is to derive a MultiSet having the numbers from the given array in possible repetitions, such… Read More

Pairs in C++: The pair container is a simple container defined in <utility> header consisting of two data elements or objects. The first element is… Read More

Given a string s and an integer X, our task is to find the number of distinct palindromic strings of length X from the given… Read More

Given an array arr[] consisting of N non-negative integers, the task is to find an integer K for every index such that at least K… Read More

Given that integers are being read from a data stream. Find the median of all the elements read so far starting from the first integer… Read More

Given an array arr, the task is to print the elements of the array in descending order along with their frequencies.Examples: Input: arr[] = {1,… Read More

Given an array arr containing N integer elements, the task is to count the minimum number of elements that need to be changed such that… Read More

Given a positive integer N and K where Attention reader! Don’t stop learning now. Get hold of all the important mathematical concepts for competitive programming… Read More