Construct smallest N-digit number possible by placing digits at positions specified by given array
Given two integers N and M and an 2D array arr[], the task is to construct the smallest possible integer of N digits ( without… Read More »
Given two integers N and M and an 2D array arr[], the task is to construct the smallest possible integer of N digits ( without… Read More »
Given a binary matrix, mat[][] of dimensions N * M, the task is to maximize the count of rows consisting only of equal elements by… Read More »
Map in STL: Maps are associative containers that store elements in a mapped fashion. Each element has a key value and a mapped value. No… Read More »
Given a binary array arr[] of size N and two players, A and B. The task is to minimize the score for player A by… Read More »
Given a string S of length N and an integer K, the task is to find the minimum character replacements required to make the string… Read More »
Given two arrays arr[] and brr[] of length N, the task is to find the minimum number of swaps of the same indexed elements required… Read More »
Given an array arr[] of size N. In each operation, pick an array element X and remove all array elements in the range [X –… Read More »
Given an integer N and an array arr[] consisting of M integers from the range [1, N]. (M – 1) operations need to performed. In… Read More »
Given an array arr[] consisting of N integers, the task for each array element arr[i] is to print the sum of |i – j| for… Read More »
Given an array arr[] consisting of N non-negative integers, the task is to find the number of operations required to make all array elements equal.… Read More »
Given an array, arr[] of size N, the task is to count the number of unordered pairs such that Bitwise AND and Bitwise OR of… Read More »
Given an array arr[] of size N and an integer S, the task is to find the count of quadruplets present in the given array… Read More »
Given an array arr[] consisting of N integers from the range [1, N]( repetition allowed ), the task is to find the minimum common element… Read More »
Given two integers K, X, and an array arr[] consisting of N distinct elements, the task is to find X elements closest to the Kth… Read More »
Joining two different tables on their matching columns can be done using nested loops, but a more efficient and scalable way is to use multimaps.… Read More »