c++, Very easy, O(n)
\'\'\'\nThe key point here is to increase the value uploaded prefix whenever we are getting continuous number.\n    \n    vector v;\n    int ans = 0;\n    LUPre
\'\'\'\nThe key point here is to increase the value uploaded prefix whenever we are getting continuous number.\n    \n    vector<bool> v;\n    int ans = 0;\n    LUPrefix(int n) {\n\t\n\t\t// defining a vector of size 1 greater n;\n        v.resize(n + 1);\n        for(int i = 0;i <n; i++){\n\t\t\n\t\t// false means the number is not uploaded\n            v[i] = false; \n        }\n    }\n    \n    void upload(int video) {\n\t\n\t// true means the number is uploaded\n        v[video - 1] = true;\n\t\t\n\t// counting the number of continuous numbers from 1\n        while(v[ans] == true){\n            ans++;\n        }   \n    }\n    \n    int longest() {\n        return ans;\n    }\n\'\'\'
['C']