Function to append str the given number of times to the StringBuilder
static void appendRepeated ( StringBuilder sb , String str , int times ) { for ( int i = 0 ; i < times ; i ++ ) sb . append ( str ) ; }