Very Very Easy| O(N)
\nclass LUPrefix {\npublic:\n    vector<int>v;\n    int count = 0;// will act as the index and the count of prefix\n    LUPrefix(int n) {\n        v.resize(n+5,
```\nclass LUPrefix {\npublic:\n    vector<int>v;\n    int count = 0;// will act as the index and the count of prefix\n    LUPrefix(int n) {\n        v.resize(n+5,0);\n    }\n    \n    void upload(int video) {\n        // Set video-1->index as 1\n        v[video-1] = 1;\n        // take count as the index and increment it until we get 0 on the index\n        while(v[count]!=0)count++; \n    }\n    \n    int longest() {\n        // As we are using 0 based indexing so the where the count is zero all the prev elements are 1 \n       return count;\n    }\n};\n\n/**\n * Your LUPrefix object will be instantiated and called as such:\n * LUPrefix* obj = new LUPrefix(n);\n * obj->upload(video);\n * int param_2 = obj->longest();\n */\n```
['C', 'C++']