One of the two distinct must appear exactly once . Either the first entry appears once , or it appears n / k - 1 times to make other sub appear once .
for i in mp : NEW_LINE INDENT if i == ( n // k - 1 ) or mp [ i ] == 1 : NEW_LINE INDENT return True NEW_LINE DEDENT DEDENT return False NEW_LINE