Function to print the common elements for all subarray lengths
static void printAnswer ( int answer [ ] , int N ) { for ( int i = 1 ; i <= N ; i ++ ) { System . out . print ( answer [ i ] + " ▁ " ) ; } }