Given a Binary Tree, the task is to find the count of diagonal paths to the leaf of a binary tree such that values of… Read More

# Category Archives: Hash

Given an array arr[] consisting of N integers in the range [0, M] and an integer M, the task is to count the number of… Read More

Given two strings str1 and str2, the task is to find the minimum number of operations required to map each character of the string str1… Read More

Given an array arr[] consisting of N positive integers and a positive integer K, the task is to find the count of array elements whose… Read More

Given an array arr[] of size N, the task is to find the smallest positive integer K such that incrementing or decrementing each array element… Read More

One person hands over the list of digits to Mr. String, But Mr. String understands only strings. Within strings also he understands only vowels. Mr.… Read More

Given an array arr[] consisting of N integers and an integer K, the task is to find the maximum number of unique elements possible by… Read More

Given an array arr[] of size N, the task is to make all array elements equal to 0 by replacing all elements of a subsequences… Read More

Given a string str and an array cost[] of size N where cost[i] denotes the cost to remove the ith character from the string str,… Read More

Given an array arr[] of size N, the task is to check if it is possible to split the array arr[] into different subsequences of… Read More

Given an array arr[] of size N, the task is for each array element is to find the nearest non-equal value present on its left… Read More

Given a character array, str[] of consisting of N lowercase alphabets, and an integer array, arr[] consisting of numbers in the range [0, N –… Read More

Given two arrays firstArr[], consisting of distinct elements only, and secondArr[], the task is to find the length of LCS between these 2 arrays. Examples:… Read More

Given an array arr[] of size N consisting of only 0s, 1s and 2s, the task is to find the count of triplets of indices… Read More

Given a Binary Tree, the task is to find the most frequent subtree sum that can be obtained by considering every node of the given… Read More