Given an array X[] of size N, then the task is to output the number of sub-arrays satisfying the given condition: The Sum of (X[i]… Read More
Category Archives: Map
Given a pile of n pairs of elements in array arr[], containing 2*n elements, we have to print with the following conditions follow: If pair… Read More
Given an array arr[] of length n, the task is to calculate the min index of the element which has maximum elements present in the… Read More
Given an array arr[] of n integers. For each index i, you have to find the sum of all integers present in the array with… Read More
Given an array X[] and a matrix M[][]. Then the task is to output the minimum elements needed to remove so that one row and… Read More
Given an array arr[] having n integers, divide the array into two halves, such that all elements in the array’s second half are unique elements.… Read More
Given an N horizontal line segments are arranged on the X-axis of a 2D plane. The start and end point of each line segment is… Read More
Given two strings str1 and str2, and a third-string shuffle, determine if shuffle is a valid shuffle of str1 and str2, where a valid shuffle… Read More
Given an array arr[], the task is to find the difference between maximum and minimum summations of consecutive odd elements in arr[]. Note: If there… Read More
Given, an array A[] of N integers, and also given two positive integers B and C, the task is to find the number of subarrays,… Read More
Design a HashMap without using any built-in hash table libraries. To be specific, your design should include these functions: put(key, value): Insert a (key, value)… Read More
Given an array A[] of N integers, the task is to find the number of subarrays of A[], which is the repetition of its’ elements… Read More
Given an array arr[] of positive integers, the task is to find the count of all the pairs (X, Y) in the array such that… Read More
Given an array A[] of N positive integers where A[i] represent the units each i can traverse in one step. You can start from position… Read More
Given an array arr[] containing N elements, the task is to find the length of the longest subarray of an input array containing at most… Read More