Given an array arr[] consisting of N positive integers, the task is to find the nearest perfect power of 2 of the nearest perfect squares… Read More
Category Archives: Hash
Given a string S representing a sequence of moves(L, R, U, and D) and two integers X and Y representing the starting coordinates, the task… Read More
Given an array arr[] consisting of N positive integers, the task is to find the sum of all array elements having a distinct count of… Read More
Given a string S consisting of lowercase English alphabets, the task is to find the length of the longest subsequence from the given string such… Read More
Given a matrix mat[][] of dimensions N * M, and an integer K, the task is to find the maximum sum of any rectangle possible… Read More
Given an array arr[] of N integers, the task for each array element is to find the number of ways of choosing a pair of… Read More
Given an array arr[] of size N, the task is to find the minimum number of array elements required to be removed such that the… Read More
Given an array arr[] consisting of 2*N integers, the task is to check if it is possible to rearrange the array elements such that arr[2… Read More
Given an array arr[] consisting of N positive integers, replace pairs of array elements whose Bitwise AND exceeds Bitwise XOR values by their Bitwise AND… Read More
Given an array of strings arr[] consisting of N strings, the task is to categorize the strings according to the hash value obtained by adding… Read More
Given two strings S1 and S2 of lengths M and N respectively, the task is to calculate the sum of the frequencies of the characters… Read More
Given an array arr[] of size N, and an integer K representing a digit, the task is to print the given array in increasing order… Read More
Given an array arr[] consisting of N positive integers, the task is to find the minimum count of divisions(integer division) of array elements by 2… Read More
Given a string S of length N and two integers M and K, the task is to count the number of substrings of length M… Read More
Given a matrix A[][] of size N*M and a 2D array Q[][] consisting of queries of the form {X, K}, the task for each query… Read More