# Category Archives: Hash

## Find the largest area rectangular sub-matrix whose sum is equal to k

Given a 2D matrix mat[][] and a value k. Find the largest rectangular sub-matrix whose sum is equal to k. Example: Input : mat =… Read More »

## Print the last occurrence of elements in array in relative order

Given an array of N elements, print the elements in the same relative order as given by removing all the occurrences of elements except the… Read More »

## Split array to three subarrays such that sum of first and third subarray is equal and maximum

Given an array of N integers, the task is to print the sum of the first subarray by splitting the array into exactly three subarrays… Read More »

## Equally divide into two sets such that one set has maximum distinct elements

There are two processes P1 and P2, and N resources where N is an even number. There is an array of N size and arr[i]… Read More »

## Frequency Measuring Techniques for Competitive Programming

Measuring the frequency of elements in an array is a really handy skill and is required a lot of competitive coding problems. We, in lot of… Read More »

## Parsing Apache access log in Java

Web server log which maintains a history of page requests, typically appended to the end of the file. Information about the request, including client IP… Read More »

## Counting frequencies of array elements

Given an array which may contain duplicates, print all elements and their frequencies. Examples: Input : arr[] = {10, 20, 20, 10, 10, 20, 5,… Read More »

## Applications of Hashing

In this article we will be discussing of applications of hashing. Hashing provides constant time search, insert and delete operations on average. This is why… Read More »

## Sum of all elements repeating ‘k’ times in an array

Given an array we have to find the sum of all the elements repeating k times in an array. We need to consider every repeating… Read More »

## Maximum length subsequence possible of the form R^N K^N

Given a string containing only two characters i.e. R and K (like RRKRRKKKKK). The task is to find the maximum value of N for a… Read More »

## Majority Element | Set-2 (Hashing)

Given an array of size N, find the majority element. The majority element is the element that appears more than times in the given array.… Read More »

## MD5 hash in Java

To calculate cryptographic hashing value in Java, MessageDigest Class is used, under the package java.security. MessageDigest Class provides following cryptographic hash function to find hash… Read More »

## Count number of Distinct Substring in a String

Given a string, count all distinct substrings of the given string. Examples: Input : abcd Output : abcd abc ab a bcd bc b cd… Read More »

## All elements in an array are Same or not?

Given an array, check whether all elements in an array are same or not Examples: Input : “Geeks”, “for”, “Geeks” Output : Not all Elements… Read More »

## Minimum length of jumps to avoid given array of obstacles

We are given coordinates of obstacles on a straight line. We start jumping from point 0, we need to reach end avoiding all obstacles. Length… Read More »