# subarray

### Print array after it is right rotated K times | Set 2

Given an array arr[] of size N and a value K, the task is to print the array rotated by…

### Minimize operations to make all array elements -1 by changing maximums of K-size subarray to -1

Given an array arr[] consisting of N integers and an integer K, the task is to find the minimum of…

### Minimize difference between maximum and minimum element of all possible subarrays

Given an array arr[ ] of size N, the task is to find the minimum difference between maximum and minimum…

### Split given Array in minimum number of subarrays such that rearranging the order of subarrays sorts the array

Given an array arr[] consisting of N integers, the task is to find the minimum number of splitting of array…

### Split array into minimum number of subsets having difference between maximum and minimum element at most K

Given an array arr[] consisting of N integers and an integer K, the task is to find the minimum number…

### Find longest subarray with Prime sum in given Array

#include using namespace std;  void SieveOfEratosthenes(    vector& prime, int total_sum){                    for (int i = 0; i

### Count of index range [L, R] in Array such that removing all its instances sorts the Array

Given an array arr[] of length N, the task is to find the number of Good Ranges in the array…

### Longest subarray with all even or all odd elements

Given an array A[ ] of N non-negative integers, the task is to find the length of the longest sub-array…