Driver Code
let arr = [ 2 , 1 , 2 , 1 , 1 , 1 , 3 ] ; let N = arr . length ; let M = 2 , K = 2 ; if ( checkExists ( arr , N , M , K ) ) { document . write ( " " ) ; } else { document . write ( " " ) ; }