Driver Code
var arr = [ 1 , 2 , 4 , 3 , 2 , 4 , 1 ] ; var n = arr . length ; var K = 7 ; var len = subArraylen ( arr , n , K ) ; if ( len == 1000000000 ) { document . write ( " " ) ; } else { document . write ( len ) ; }