Function for two Sum
def twoSum ( nums , N ) : NEW_LINE INDENT Map = { } NEW_LINE for i in range ( N - 1 ) : NEW_LINE INDENT for j in range ( i + 1 , N ) : NEW_LINE INDENT Map [ nums [ i ] + nums [ j ] ] = [ ] NEW_LINE Map [ nums [ i ] + nums [ j ] ] . append ( i ) NEW_LINE Map [ nums [ i ] + nums [ j ] ] . append ( j ) NEW_LINE DEDENT DEDENT return Map NEW_LINE DEDENT