# Arrays

### Minimum length of a rod that can be split into N equal parts that can further be split into given number of equal parts

Minimum length of a rod that can be split into N equal parts that can further be split into given…

### Generate an N-length array having maximum element minimized and sum of array elements divisible by K

Generate an N-length array having maximum element minimized and sum of array elements divisible by KGiven two positive integers N…

### Maximum ranges that can be uniquely represented by any integer from the range

Given an array arr[] consisting of N ranges of the form {L, R}, the task is to find the maximize…

### Find the array element having equal count of Prime Numbers on its left and right

#include using namespace std;  int findIndex(int arr[], int N){            int maxValue = INT_MIN;          for (int i = 0; i < N; i++) {        maxValue…

### Minimum removal of elements from end of an array required to obtain sum K

#include using namespace std;  int minSizeArr(int A[], int N, int K){            int leftTaken = N, rightTaken = N;          int leftSum = 0, rightSum…

### Numbers of pairs from an array whose average is also present in the array

import java.io.*;import java.util.*;  class GFG {              static int getCountPairs(int arr[],                             int N, int S)    {        HashMap mp            = new HashMap();                          for (int i = 0; i <…

### Minimum operations required to make all elements in an array of first N odd numbers equal

Minimum operations required to make all elements in an array of first N odd numbers equalGiven an array consisting of…

### Minimum difference possible between two given numbers by rearranging their digits in the same order

#include using namespace std;  int minDifference(int X, int Y){        int minDiff = INT_MAX;          string x = to_string(X);          string y = to_string(Y);          int n = x.size();          int…