To handle the case like arr [ i ] = 4 and arr [ j ] = 2
elif ( result == arr [ j ] and ( result in m . keys ( ) ) and m [ result ] > 1 ) : NEW_LINE INDENT return arr [ i ] NEW_LINE DEDENT j += 1 NEW_LINE return - 1 NEW_LINE