count = 0 # lets say count == 3, it means until this idx, if 0 appeared x time, 1 appeared x+3 time res = 0 # So, once count == 3 appears at the other position again, for i in range(len(nums)): # ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results