C++ | Vector | Easy & Short Solution
\nclass LUPrefix {\n    vector<int> mp;\n    int i = 1;\n    int len;\npublic:\n    LUPrefix(int n) {\n        mp.resize(n+1);\n        len = n;\n    }\n    \n 
```\nclass LUPrefix {\n    vector<int> mp;\n    int i = 1;\n    int len;\npublic:\n    LUPrefix(int n) {\n        mp.resize(n+1);\n        len = n;\n    }\n    \n    void upload(int video) {\n        mp[video] = 1;\n        while( i <= len && mp[i] ){\n            i++;\n        }\n    }\n    \n    int longest() {\n        return i-1;\n    }\n};\n```
['C']