Driver Code
public static void main ( String [ ] args ) { int arr [ ] = { 6 , 1 , 3 , 3 , 3 , 3 } ; int M = 1 , K = 3 ; int N = arr . length ; System . out . print ( checkPattern ( arr , M , K , N ) ) ; } }