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