## Count of pairs between two arrays such that the sums are distinct

Given two arrays a[] and b[], the task is to find the count of all pairs (a[i], b[j]) such that a[i] + b[j] is unique… Read More »

Given two arrays a[] and b[], the task is to find the count of all pairs (a[i], b[j]) such that a[i] + b[j] is unique… Read More »

Given a number N. Add one to the number in the first step and if the number has trailing zeros, remove all the trailing zeros… Read More »

Given two arrays arr1[] and arr2[] of sizes N and M where 0 ≤ arr1[i], arr2[i] ≤ 1000 for all valid i, the task is… Read More »

Given an unsorted sequence a[], the task is to find the K-th missing contiguous element in the increasing sequence of the array elements i.e. consider… Read More »

Given N strings of equal lengths. The strings contain only digits (1 to 9). The task is to count the number of strings that have… Read More »

Given an array arr[] of N elements and an integer K, the task is to find the number of ways of choosing an integer X… Read More »

Unordered_set provides two operators in C++ STL. These are: Syntax: 1. (unordered_set &lhs == unordered_set &rhs) 2. (unordered_set &lhs != unordered_set &rhs) These operators are… Read More »

Given an array of N elements, the task is to find all the unique pairs that can be formed using the elements of a given… Read More »

Given an unsorted array, count all distinct elements in it. Examples: Input : arr[] = {10, 20, 20, 10, 30, 10} Output : 3 There… Read More »

Given an array arr[] and an integer K. The task is to find the size of the maximum sub-set such that every pair from the… Read More »

The unordered_set internally implements a hash table to store elements. By default we can store only pre definded type as int, string, float etc. If… Read More »

Given an array of N elements, the task is to check if the array has an element which is equal to the product of all… Read More »

Given a sorted array (with unique entries), we have to find whether there exist an element(say X) which is exactly half the sum of all… Read More »

Given an array of elements and change the array in such a way that all the elements on the array are distinct. if you are… Read More »

Given an integer array, if any integer is repeating then replace it with a number greater than that number which has not been inserted yet… Read More »