Skip to content

Category Archives: Arrays

Given a positive integer arr[] of length L (2 ≤ L ≤ 2000) containing elements from 1 to L in unsorted order and an integer… Read More
Given an array arr[] of size N, the task is to find the maximum number of sub-arrays such that the GCD(Greatest Common Factor) of all… Read More
Given an integer array Arr[] of length N and an array Queries[] of length Q where Queries[i] = [valuei, indexi]. For each query i, update… Read More
Given a number N, the task is to find a permutation A[] of first N integers such that the absolute difference of adjacent elements is… Read More
Given an array arr[] of length N consisting positive integers and an integer X, the task is to find the maximum number of adjacent Sub-Arrays… Read More
Given an array arr[] of size N, the task is to minimize the number of distinct elements in the array after performing the following operation… Read More
Given an array arr[] of length N, denoting the cost of N items and the cashback upon buying that item, the task is to find… Read More
Given an array arr[] of length N, the task is to find the total number of elements that has frequency 1 in a subarray of… Read More
Geek has N packs of chocolates and the amount of chocolates in each pack is given in an array arr[]. His sister wants to have… Read More
What is an Array? An array is a collection of similar data elements stored at contiguous memory locations. It is the simplest data structure where… Read More
Given two arrays A[] and B[] of size N and M respectively denoting the required elements of each group and the number of elements in… Read More
Given two arrays A[] and B[] of size N each, the task is to find the number of elements in array B[] that occur before… Read More
Given an input arr[] of length N, Which contains integers from 1 to N in unsorted order. You can apply only one type of operation… Read More
Given an array A consisting of N positive integers and for any ordered triplet( i, j, k) such that i, j, and k are all… Read More
Given a set S of having numbers 1, 2, 3, . . ., N, and an integer K, the task is to form a set… Read More

Start Your Coding Journey Now!