If elements of any pair are not equal and their frequency is not same update the isArrayPossible variable to false and break through the loop
if ( first != s1 - first ) : NEW_LINE INDENT if s1 - first in mp : NEW_LINE INDENT if ( mp [ first ] != mp [ s1 - first ] ) : NEW_LINE INDENT isArrayPossible = False ; NEW_LINE break ; NEW_LINE DEDENT DEDENT DEDENT