# Category Archives: Arrays

Given two arrays A[] and B[] (B[i] < A[i]) of size N each and an integer K, the task is to perform the operation of… Read More
Given a binary array arr[] of size N which is starting from index 0, the task is to reach the end of the array in… Read More
Given a sorted integer array traveldays[] represents the days of a year one must travel, and two arrays cost[] and span[] array of size 3… Read More
Given an array arr[] of size N, the task is to check if it is possible to make all array elements consecutive by performing any… Read More
Given a 2-dimensional integer array arr[] representing N ranges, each of type [starti, endi] (starti, endi ≤ 109) and Q queries represented in array query[],… Read More
Given an integer M and a sorted integer array arr[] of length N containing 1 and N-1 prime numbers, each appearing just once, the task… Read More
Given an integer N and an array arr[] of M pairs of type (Ai, Bi), the task is to generate the lexicographically smallest possible permutation… Read More
Given an array arr[] of size N, the task is to calculate the minimum number of elements to be removed from the array such that… Read More
Given an integer array having N elements ranging from 1 to N and each element appearing exactly once. The task is to find the number… Read More
Given an array arr[] of length N, and an array queries[] of size Q, the task is to find the number of missing elements from… Read More
Given an array arr of length N of distinct numbers and an integer X, the task is to find the minimum number of elements that… Read More
Given an array arr[] of size N and three integers X, Y and K, the task is to count the number of pairs (i, j)… Read More
Given an array arr[] of size N, the task is to find the minimum difference between the maximum and the minimum subarray sum when the… Read More
Given three arrays A[], B[] and C[] of size N each and two integers X and Y, the task is to, find the minimum cost… Read More
Given an array arr[] of positive integers of size N, the task is to divide the array into two non-empty subsets X and Y in… Read More