Driver Code
public static void Main ( String [ ] args ) { int [ ] arr = { 1 , 2 , 4 , 3 , 2 , 4 , 1 } ; int n = arr . Length ; int K = 7 ; int len = subArraylen ( arr , n , K ) ; if ( len == int . MaxValue ) { Console . Write ( " - 1" ) ; } else { Console . Write ( len + " STRNEWLINE " ) ; } } }