✅✅✅ C++ with Explanation || Very Simple & Easy to Understand Solution
Up Vote if you like the solution \n\n\n/* take an array that keeps a mark of each of the video that uploaded.\n   keep another varible - latest, that keeps trac
<b>Up Vote if you like the solution \n```\n\n/* take an array that keeps a mark of each of the video that uploaded.\n   keep another varible - latest, that keeps track of all the video that\n   has been already uploaded till that point of time.\n   Update latest, when the new video uploaded just next to it, also keep \n   on checking for next videos if those were updated before or not at the \n   same time.\n */\nclass LUPrefix {\npublic:\n    vector<bool> isupdated;\n    int latest;\n    LUPrefix(int n) {\n        isupdated.resize(n+1, 0);\n        latest = 0;\n    }\n    \n    void upload(int video) {\n        isupdated[video] = 1;\n        if(latest == video-1){\n            while(isupdated[video] == 1 && video < isupdated.size()){\n                latest = video;\n                video++;\n            }\n        }\n    }\n    \n    int longest() {\n        return latest;\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```
[]