Function to check if array can be split into K consecutive and non - overlapping subarrays of length M consisting of a single distinct element
static String checkPattern ( int [ ] arr , int m , int k , int n ) { int count = 1 , t = 0 ;