Stores the index of each number
for i in range ( N ) : NEW_LINE INDENT if nums [ i ] in idx : NEW_LINE INDENT idx [ nums [ i ] ] . add ( i ) NEW_LINE DEDENT else : NEW_LINE INDENT idx [ nums [ i ] ] = { i } NEW_LINE DEDENT DEDENT