stream of size n with False values.maxLength to n and prefLength to 0.upload is called with a video number, set stream[video - 1] to True.longest is called, iterate from prefLength to maxLength.
stream[i] is True, increment prefLength.stream[i] is False, break the loop.prefLength as the length of the longest uploaded prefix.