GFG : Maximum MEX from all subarrays of length K
Given an array arr[] consisting of N distinct integers and an integer K, the task is to find the maximum MEX from all subarray of length K. The MEX is the smallest positive integer that is not present in the array. Solution :