# Tag Archives: Arrays

## Minimize operations required to make each element of Array equal to it’s index value

Given an array arr[] consisting of N integers, the task is to to modify the array such that arr[index] = index using minimum number of… Read More »

## Number of times an array can be partitioned repetitively into two subarrays with equal sum

Given an array arr[] of size N, the task is to find the number of times the array can be partitioned repetitively into two subarrays… Read More »

## Find the missing number in unordered Arithmetic Progression

Given an unsorted array arr[] of N integers that are in Arithmetic Progression, the task is to print the missing element from the given series.… Read More »

## Convert one array to another using adjacent swaps of elements

Given two arrays arr1[] and arr2[] of N integers. We can choose any two adjacent elements from array arr1[] and swap them if they are… Read More »

## Minimize insertions in an array to obtain all sums upto N

Given a sorted array arr[] of positive integers of size K, and an integer N, where some numbers can be inserted into the array such… Read More »

## Check if the end of the Array can be reached from a given position

Given an array arr[] of N positive integers and a number S, the task is to reach the end of the array from index S.… Read More »

## Queries for elements having values within the range A to B in the given index range using Segment Tree

Given an array arr[] of N elements and two integers A to B, the task is to answer Q queries each having two integers L… Read More »

## Queries for maximum and minimum difference between Fibonacci numbers in given ranges

Given an array arr[][] containing N queries of the form [L, R], the task is to find the maximum difference between two Fibonacci numbers in… Read More »

## Print the array after K operations

Given an array arr[] of size N and a number K. The task is to print the array arr[] after K operations such that at… Read More »

## Check if the XOR of an array of integers is Even or Odd

Given an array arr containing integers of size N, the task is to check if the XOR of this array is even or odd Examples:… Read More »

## Count of strings possible by replacing two consecutive same character with new character

Given a string str. The task is to count the number of all different strings possible if two consecutive same characters of the string can… Read More »

## Longest sub-array of Prime Numbers using Segmented Sieve

Given an array arr[] of N integers, the task is to find the longest subarray where all numbers in that subarray are prime. Examples: Input:… Read More »

## Maximum sum of elements divisible by K from the given array

Given an array of integers and a number K. The task is to find the maximum sum which is divisible by K from the given… Read More »

## Array of Vectors in C++ STL

Prerequisite: Arrays in C++, Vector in C++ STL An array is a collection of items stored at contiguous memory locations. It is to store multiple… Read More »

## Find the weight at (Xi, Yi) after M operations in a Matrix

Given n x n points on cartesian plane, the task is to find the weight at (xi, yj) after m operation. xi, yj, w denotes… Read More »