Given an array arr[]. The task is to minimize the number of removals to make all the elements in arr[] consecutive. Examples Input: arr[] =… Read More

# Category Archives: Hash

Given an array arr[] of size N. The task is to find the number of sequences in which any one of the following conditions is… Read More

Given an integer array arr[] of size N and a positive integer K, the task is to count all the pairs in the array with… Read More

Given a binary string str. The task is to find the size of the set(contains unique substrings) of substrings such that if there is a… Read More

Given a N x N matrix, such that the element at the index [N/2, N/2] is missing, the task is to find the maximum integer… Read More

Given an array arr[], the task is to find the number of times the current integer has already occurred during array traversal. Examples: Input: arr[]… Read More

Given an array arr[] of N integers and an array query[] having Q integers, the task is to print the array arr[] after moving the… Read More

Given an array arr[], of size N the task is to find the minimum operations on the array such that in each operation any element… Read More

Given a sorted array of distinct positive integers, print all triplets that form AP (or Arithmetic Progression)Examples : Input : arr[] = { 2, 6,… Read More

Given an array of strings arr[]. The task is to generate the string which contains all the characters of all the strings present in array… Read More

Given a 2D matrix arr of size N*M containing lowercase English letters, the task is to find the number of unique rows in the given… Read More