# Category Archives: Hash

## Sum of all odd frequency elements in an array

Given an array of integers containing duplicate elements. The task is to find the sum of all odd occurring elements in the given array. That… Read More »

## Check if a pair with given product exists in a Matrix

Given a NxM matrix and a product K. The task is to check if a pair with the given product exists in the matrix or… Read More »

## Pair with given sum in matrix

Given a NxM matrix and a sum S. The task is to check if a pair with given Sum exists in the matrix or not.… Read More »

## Sum of all even occurring element in an array

Given an array of integers containing duplicate elements. The task is to find the sum of all even occurring elements in the given array. That… Read More »

## Find the sum of all highest occurring elements in an Array

Given an array of integers containing duplicate elements. The task is to find the sum of all highest occurring elements in the given array. That… Read More »

## Sum of all minimum occurring elements in an Array

Given an array of integers containing duplicate elements. The task is to find the sum of all least occurring elements in the given array. That… Read More »

## Check if a string can be rearranged to form special palindrome

Given a string str, the task is to check if it can be rearranged to get a special palindromic string. If we can make it… Read More »

## Construct a frequency array of digits of the values obtained from x^1, x^2, …….., x^n

Given are two integers (x and n). The task is to find an array such that it contains the frequency of index numbers occurring in… Read More »

## Check if there is any common character in two given strings

Given two strings. The task is to check that is there any common character in between two strings. Examples: Input: s1 = “geeksforgeeks”, s2 =… Read More »

## Design a data structure for LRU Cache

Design a data structure for LRU Cache. It should support the following operations: get and set. get(key) – Get the value (will always be positive)… Read More »

## Replace minimal number of characters to make all characters pair wise distinct

Given a string consisting of only lowercase English alphabets. The task is to find and replace the minimal number of characters by any lower case… Read More »

## Sort elements by frequency | Set 5 (using Java Map)

Given an integer array, sort the array according to the frequency of elements in decreasing order, if frequency of two elements are same then sort… Read More »

## Address Calculation Sort using Hashing

In this sorting algorithm, Hash Function f is used with the property of Order Preserving Function which states that if . Hash Function: f(x) =… Read More »

## Minimize the length of string by removing occurrence of only one character

Given a string str containing only lowercase alphabets, the task is to minimize the length of the string after performing the following operation: Delete all… Read More »

## Minimum removals from array to make GCD greater

Given N numbers, the task is to find the minimum removal of numbers such that GCD of the remaining numbers is greater than initial GCD… Read More »