✅✅✅🤓😎O(n) Solution with Most Easy Solution and Question too
****Very Simple and Straight Forward Approch\n\n\nclass LUPrefix {\n\n    private:  vector<bool>server;\n                int ind=-1,maxi=0,_n;\n    public:\n   
****Very Simple and Straight Forward Approch\n\n```\nclass LUPrefix {\n\n    private:  vector<bool>server;\n                int ind=-1,maxi=0,_n;\n    public:\n    LUPrefix(int n) {\n        server.resize(n+5,0);\n        server[0]=1;\n        _n=n;\n    }\n    \n    void upload(int video) {\n        server[video]=1;\n        if(server[video-1]==1)check();\n    }\n    \n    int longest() {\n        return maxi;\n    }\n    void check(){\n        while(maxi<=_n && server[maxi]!=0){\n            maxi++;\n        }\n        maxi--;\n    }\n};\n\n```
['Array', 'C++']