# Category Archives: Arrays

Given an integer N (N is odd). the task is to construct an array arr[] of size N where 1 ≤ arr[i] ≤ N such… Read More
Given an array arr[] of length N, the task is to check whether the given array forms a valley or not. An array is said… Read More
Given an array arr[] of length N, the task is to find the count of non-overlapping subarrays of size K such that the alternate elements… Read More
Given an array arr[] consisting of N distinct integers and a 2d array Q[][3] consisting of M queries of the 2 types whose operations are… Read More
Given arrays A[] and B[] each of length N and A[i] has all the elements from 1 to N, the task is to check if… Read More
Given an arr[] of length N, the task is to make parity of arr[] the same by using the below-provided operation: Select a subarray containing… Read More
Given two arrays X[] and Y[] of length N along with Q queries each of type [L, R] that denotes the subarray of X[] from… Read More
Given an array arr[] (where arr[i] lies in the range [2, 30] )of size N, the task is to find the number of subsets such… Read More
You are given two integers N and M (M ≤ N), the task is to create an array of length N following the below-given conditions.… Read More
Given two arrays arr1[] and arr2[] of size N and M (M < N) add all elements of arr2[] in all possible subarrays of arr1[]… Read More
Given an arr[] of length N, the task is to find the smallest possible sum of the array when we can subtract 1 and 2… Read More
Given 2 arrays arr1[] and arr2[], of size N and M respectively, the task is to find a pair of value (say a and b)… Read More
Given an array a[] of 2*N integers, The task is to make the array a[] of size N i.e, reducing it to half size such… Read More
Given two arrays X[] and Y[] of length N each. You can shift from X[] to Y[] at most once. The task is to output… Read More
Given an array of positive elements arr[] of length N, the task is to count all the subarrays such that the product of the subarray… Read More