## Print Minimum of all Subarrays using set in C++ STL

Given an array of size N and an integer K, find the minimum for each and every contiguous subarray of size K. Examples: Input :… Read More »

- Pair in C++ Standard Template Library (STL)
- Given a string, find its first non-repeating character
- Merge k sorted arrays | Set 2 (Different Sized Arrays)
- Count number of triplets with product equal to given number with duplicates allowed | Set-2
- Sorting Array Elements By Frequency | Set 3 (Using STL)
- Map of pairs in STL
- Priority queue of pairs in C++ (Ordered by first)
- Longest subarray having average greater than or equal to x
- Find top three repeated in array
- Sorting an array according to another array using pair in STL
- Count subarrays where second highest lie before highest
- LFU (Least Frequently Used) Cache Implementation
- Binary search in sorted vector of pairs
- Print Minimum of all Subarrays using set in C++ STL
- Minimum number of swaps required to sort an array | Set 2
- Perform the given queries on the rooted tree
- Find largest d in array such that a + b + c = d
- Sets of pairs in C++
- Minimum number of prefix reversals to sort permutation of first N numbers
- C++ programming and STL facts
- Minimum number of operations to convert a given sequence into a Geometric Progression
- Operator overloading in C++ to print contents of vector, map, pair, ..
- Sum of minimum difference between consecutive elements of an array
- Check if a king can move a valid move or not when N nights are there in a modified chessboard
- Find k pairs with smallest sums in two arrays | Set 2
- Pair of arrays with equal sum after removing exactly one element from each

Given an array of size N and an integer K, find the minimum for each and every contiguous subarray of size K. Examples: Input :… 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 »

Given a rooted tree and not necessarily binary. The tree contains N nodes, labeled 1 to N. You are given the tree in the form… Read More »

Given an infinite chessboard with the same rules as that of chess. Also given are N knights coordinates on the infinite chessboard(-10^9 {3, 4} Output:… Read More »

Given an array of N distinct elements, find the minimum number of swaps required to sort the array. Note: The problem is not asking 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 integers and an integer x. Find length of maximum size subarray having average of integers greater than or equal to x.… Read More »

In C++, priority_queue implements heap. Below are some examples of creating priority queue of pair type. Max Priority queue (Or Max heap) ordered by first… Read More »

Given an array of pairs where each pair represents a range, the task is to find the sum of the minimum difference between the consecutive… Read More »

Given k sorted arrays of possibly different sizes, merge them and print the sorted output. Examples: Input: k = 3 arr[][] = { {1, 3},… Read More »

Least Frequently Used (LFU) is a caching algorithm in which the least frequently used cache block is removed whenever the cache is overflowed. In LFU… Read More »

Given two arrays arr1[] and arr2[] sorted in ascending order and an integer K. The task is to find k pairs with smallest sums such… Read More »

Given a sequence of N elements, only three operations can be performed on any element at most one time. The operations are: Add one to… Read More »

Given K arrays of different size. The task is to check if there exist any two arrays which have the same sum of elements after… Read More »

Given N numbers which have a permutation of first N numbers. In a single operation, any prefix can be reversed. The task is to find… Read More »