Insert temp_str into final_str ( n / 2 k ) times and add ( n % 2 k ) characters of temp_str at end
for ( int i = 0 ; i < n / ( 2 * k ) ; i ++ ) { final_str += ( temp_str ) ; } for ( int i = 0 ; i < n % ( 2 * k ) ; i ++ ) { final_str . push_back ( temp_str [ i ] ) ; }