Insert temp_str into final_str ( n / 2 k ) times and add ( n % 2 k ) characters of temp_str at end
INDENT for i in range ( 0 , n // ( 2 * k ) ) : NEW_LINE INDENT final_str += ( temp_str ) NEW_LINE DEDENT for i in range ( 0 , n % ( 2 * k ) ) : NEW_LINE INDENT final_str += ( temp_str [ i ] ) NEW_LINE DEDENT DEDENT