98% FASTER || C++ || USE ARRAY || EASY APPROACH
\nclass LUPrefix {\npublic:\n    int x = 1;\n    vector<bool> v;\n    LUPrefix(int n) {\n        v.resize(100002,false);\n    }\n    \n    void upload(int video
```\nclass LUPrefix {\npublic:\n    int x = 1;\n    vector<bool> v;\n    LUPrefix(int n) {\n        v.resize(100002,false);\n    }\n    \n    void upload(int video) {\n        v[video] = true;\n        while(v[x]==true){\n            x++;\n        }\n    }\n    \n    int longest() {\n        return x-1;\n    }\n};\n```
['Array', 'C', 'C++']