Thanks for the video. I think the intuition section could be a little more thorough in the reasoning before jumping into the approach. The key intuition comes from the problem statement: that a celebrity must not know anyone AND must be known by everyone. Thus, if you initialize a possible candidate, say A, and they know B, they are not a candidate. But there is a second half to this - why is it that if they DON'T know B, we can throw away B as an option? Because B MUST be known to be a candidate. Its obvious after reasoning it out, but tricky. Then, after one loop, what do we know? We know that the most recent candidate didn't know the portion of the people from candidateIndex to n. But we don't know if the candidate knows anyone from 0 to candidateIndex. We also don't know if EVERYONE knows the candidate. So, you must do 1 final pass.
Yea Leetcode is annoying sometimes. I think they use a dynamic threshold based on like some percentile of runtime to determine the cutoffs. Funny when the official solution times out though