# Category Archives: Hash

## Minimum number of rabbits that must be present in the forest

There are some colored rabbits in a forest. Given an array arr[] of size N, such that arr[i] denotes the number of rabbits having same… Read More »

## Count clockwise array rotations required to maximize count of array elements present at indices same as their value

Given an array arr[] consisitng of a permutation of first N natural numbers, the task is to find the minimum number of clockwise circular rotations… Read More »

## 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 »

## Find the order of execution of given N processes in Round Robin Scheduling

Given an array arr[] representing burst time of N processes scheduled using the Round Robin Algorithm with given quantum time Q. Assuming that all the… Read More »

## Check if a given string can be converted to another by given possible swaps

Given two strings str1 and str2, the task is to check if a string str1 can be converted to string str2 by performing the following… Read More »

## Print all distinct strings from a given array

Given an array of strings arr[] of size N, the task is to print all the distinct strings present in the given array.  Examples: Input:… Read More »

## Print all strings from given array that can be typed using keys from a single row of a QWERTY keyboard

Given an array of strings arr[], consisting of strings made up of lowercase and uppercase letters, the task is to print all the strings from… Read More »

## Maximize count of rows consisting of equal elements by flipping columns of a Matrix

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 »

## Partition array into minimum number of equal length subsets consisting of a single distinct value

Given an array arr[] of size N, the task is to print the minimum count of equal length subsets the array can be partitioned into… Read More »

## Largest divisor of a number not divisible by another given number

Given two positive integers P and Q, the task is to largest divisor of P which is not divisible by Q. Examples: Input: P =… Read More »

## Minimum cost to convert one given string to another using swap, insert or delete operations

Given two strings A and B of length N and M respectively, the task is to find the minimum cost to convert string A to… Read More »

## Minimum characters required to be removed to make frequency of each character unique

Given string str, the task is to find the minimum count of characters that need to be deleted from the string such that the frequency… Read More »

## Lexicographically largest string possible consisting of at most K consecutive similar characters

Given a string S and an integer K, the task is to generate lexicographically the largest string possible from the given string, by removing characters… Read More »

## Append digits to the end of dupicate strings to make all strings in an array unique

Given an array arr[] consisting of N strings, the task is to modify the array by replacing the duplicate strings by appending ay number such… Read More »

## Count ways to split array into two equal sum subarrays by replacing each array element to 0 once

Given an array arr[] consisting of N integers, the task is to count the number of ways to split the array into two subarrays of… Read More »