Leetcode array doubt

in this question in the first example its given that 5 is not occuring 2 times but in the given array 5 is occuring 2 wice only and also how the output is 7

hello @Somasree

[2,2,1,1,5,3,3,5]

consider prefix [2,2,1,1,5,3,3]
from this prefix remove 5 and then u will left with [2,2,1,1,3,3] here all elements have same frequency hence the chosen prefix is a valid prefix and it has lenght 7

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.