Function that returns true if sub - string s [ 0. . . k ] is repeated a number of times to generate String s
static bool check ( string s , int k ) { for ( int i = 0 ; i < s . Length ; i ++ ) { if ( s [ i ] != s [ i % k ] ) { return false ; } } return true ; }