Skip to content

Category Archives: Arrays

Given an array arr[] and three integers X, Y, Z, the task is to find the number of subarrays from the array in which the… Read More
Given an array arr[] consisting of N integers, the task is to count the number of integers in the range [1, arr[i]] that does not… Read More
Given a 2D array representing width and level of tiles of equal length, with each level of same total width, the task is to find… Read More
Given an array of strings arr[], where each arr[i] is of the form “i==j” or “i!=j”, where i and j are variables representing relationships among… Read More
Given an array arr[] consisting of N intervals of the form of [L, R], where L, R denotes the start and end positions of the… Read More
Given an array arr[] consisting of N integers, the task is to construct a Product array of the same size without using division (‘/’) operator… Read More
Given a positive integer N, the task for any permutation of size N having elements over the range [0, N – 1], is to calculate… Read More
Given an array A[] consisting of N integers, the task is to count the number of pairs (i, j) such that i < j, and… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to find the minimum sum of incompatibilities of K subsets… Read More
Given an array arr[] consisting of N integers and an integer K, the task is to find the longest subsequence of the given array such… Read More
Given two arrays A[] and B[] consisting of N integers representing the amount of each type of candies and maximum consumable limit respectively, and an… Read More
Given an array arr[] and an integer K, the 0th index, the task is to collect the maximum score possible by performing the following operations:  … Read More
Given an array arr[] and an integer K, the task is to print the position of the array elements, where the ith value in the… Read More