connect the two indices
for i in range ( int ( n / 2 ) ) : NEW_LINE INDENT connectchars [ arr [ i ] ] . append ( arr [ n - i - 1 ] ) NEW_LINE connectchars [ arr [ n - i - 1 ] ] . append ( arr [ i ] ) NEW_LINE DEDENT