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

# Tag Archives: Java-HashMap

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 size N, and integer K. The task is to find the longest subsequence with the difference between adjacent elements as… Read More

Given an integer array arr[]. Create a new array which is a rotation of given array and find the maximum Hamming distance between both the… Read More

Given an array A of size N and an integer B, the task is to find all unique quadruplets arranged in the lexicographically increasing order… Read More

Given a Binary Tree consisting of N nodes, the task is to first compress the tree diagonally to get a list of integers and then,… Read More

Here we will be discussing out how we can, we improve the performance while using HashMap in Java, the Importance of the hashCode() contract and… Read More

Given a 2D array arr[][], representing width of bricks of the same height present on a wall, the task is to find the minimum number… Read More

Given an array arr[] consisting of N integers and an integer K, the task is to print all possible unique quadruplets (arr[i], arr[j], arr[k], arr[l])… Read More

JSON is an open standard file format, and easier data interchange format helpful for humans to transmit data. Most of the apps display JSON data… Read More

Given an integer N, the task is to check whether the given number is a pangram or not. Note: A Pangram Number contains every digit [0-… Read More

Given a string S and a binary string B, both of length N, the task is to check if the given string S can be… Read More

HashMap<Key, Value> provides the basic implementation of the Map interface of Java and import java.util.HashMap package or its superclass. HashMap stores the data in (Key,… Read More

Given an array A[] consisting of N integers and an integer K, the task is to count the minimum number of distinct elements present in… Read More