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