# Category Archives: Arrays

Given an array nums[] of size N, the task is to find the maximum difference between the sum of even and odd indexed elements of… Read More
Given an array that may contain duplicates, print all elements and their frequencies. Examples Input : arr[] = {10, 20, 20, 10, 10, 20, 5,… Read More
Given a binary array A[] of length N, the task is to find the minimum number of operations required such that no adjacent pair has… Read More
Given a binary array A[] of length N, the task is to find the minimum number of operations required so that array A is sorted… Read More
Given a positive integer array arr[] of size N (1 ≤ N ≤ 105) and a positive integer K, the task is to find the… Read More
Given a positive integer array jobs[] and positive integer K, jobs[i] represent the type of the ith job and K represents the minimum number of… Read More
Given a sorted array arr[] consisting of N integers which denote the position of a stall. You are also given an integer K which denotes… Read More
Given an array A[] of size N (0 ≤ A[i] ≤ 109). The following operations can be performed on the array. Choose a random integer… Read More
Given an integer array arr[] of size N and a positive integer K, the task is to minimize the maximum of the array by replacing… Read More
Given an arr[] containing distinct positive integers of length N(2 ≤ N), the task is to rearrange the array elements in such a way that… Read More
Given an array arr[] of size N, the task is to count all pair of indices (i, j) such that i < j and j… Read More
Given an array, arr[], and the cost array cost[], the task is to find the minimum cost to make all the array elements equal by… Read More
Given an array arr[] of size N, the task is to find the minimum number of jumps to reach the last index of the array… Read More
Given an array arr[] having positive integers of size N, and a non-negative integer K, the task is to find the minimum number of division… Read More
You are given an array A[] of size N, the task is to divide the array into exactly three subarrays such that every element belongs… Read More