Minimize range [L, R] to divide Array into K subarrays with majority elements in [L, R]
Given an array arr[] of size N, the task is to find the minimum value range [L, R] such that: The array can be divided into K sub-arrays.The elements within the range [L, R] are greater than the elements which are out of the range[l, r]. Examples: Input: arr[] = {1, 2, 2, 2}, K = 2Output: 2 2Explana