# Category Archives: Hash

## Pairs of Positive Negative values in an array

Given an array of distinct integers, print all the pairs having positive value and negative value of a number that exists in the array. We… Read More »

## k-th missing element in increasing sequence which is not present in a given sequence

Given two sequences, one is increasing sequence a[] and another a normal sequence b[], find the K-th missing element in the increasing sequence which is… Read More »

## Shortest substring of a string containing all given words

Print the shortest sub-string of a string containing all the given words. In the first example, two solutions are possible: “world is here. this is… Read More »

## Implementing own Hash Table with Open Addressing Linear Probing in C++

Prerequisite – Hashing Introduction, Implementing our Own Hash Table with Separate Chaining in Java In Open Addressing, all elements are stored in the hash table… Read More »

## Find winner of an election where votes are represented as candidate names

Given an array of names of candidates in an election. A candidate name in array represents a vote casted to the candidate. Print the name… Read More »

## Difference between highest and least frequencies in an array

Given an array, find the difference between highest occurrence and least occurrence of any number in an array Examples: Input : arr[] = [7, 8,… Read More »

## Maximum length subsequence with difference between adjacent elements as either 0 or 1 | Set 2

Given an array of n integers. The problem is to find maximum length of the subsequence with difference between adjacent elements in the subsequence as… Read More »

## Remove minimum number of elements such that no common element exist in both array

Given two arrays A[] and B[] consisting of n and m elements respectively. Find minimum number of elements to remove from each array such that… Read More »

## Maximum area rectangle by picking four sides from array

Given an array of n positive integers that represent lengths. Find out the maximum possible area whose four sides are picked from given array. Note… Read More »

## Sort elements by frequency | Set 4 (Efficient approach using hash)

Print the elements of an array in the decreasing frequency if 2 numbers have same frequency then print the one which came first. Examples: Input… Read More »

## Minimum operation to make all elements equal in array

Given an array with n positive integers. We need to find the minimum number of operation to make all elements equal. We can perform addition,… Read More »

## Find substrings that contain all vowels

We have been given a string in lowercase alphabets. We need to print substrings that contain all the vowels at-least one time and there are… Read More »

## Frequency of a string in an array of strings

You are given a collection of strings and a list of queries. For every query there is a string given. We need to print the… Read More »

## Concatenated string with uncommon characters of two strings

Two strings are given and you have to modify 1st string such that all the common characters of the 2nd strings have to be removed… Read More »

## Smallest element repeated exactly ‘k’ times (not limited to small range)

Given an array of size n, the goal is to find out the smallest number that is repeated exactly ‘k’ times where k > 0?… Read More »