## 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 »

- Array of Vectors in C++ STL
- Queries for elements having values within the range A to B in the given index range using Segment Tree
- Queries for maximum and minimum difference between Fibonacci numbers in given ranges
- Maximum sum of elements divisible by K from the given array
- Longest sub-array of Prime Numbers using Segmented Sieve
- Check if the end of the Array can be reached from a given position
- Check if the XOR of an array of integers is Even or Odd
- Print the array after K operations
- Count of strings possible by replacing two consecutive same character with new character
- Minimize insertions in an array to obtain all sums upto N

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »

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 »