✅✅Faster || Easy To Understand || C++ Code
Array\n\n\nclass LUPrefix {\npublic:\n    \n    vector<int> arr;\n    \n    // longest will keep track of untill (longest - 1) we have got the longest uploaded 
* ***Array***\n\n```\nclass LUPrefix {\npublic:\n    \n    vector<int> arr;\n    \n    // longest will keep track of untill (longest - 1) we have got the longest uploaded prefix\n    \n    int longestt = 1;\n    \n    LUPrefix(int n) {\n        \n        arr.assign(n + 1, 0);\n    }\n    \n    void upload(int video) {\n        \n        arr[video]++;\n    }\n    \n    int longest() {\n        \n        while(longestt < arr.size())\n        {\n            if(arr[longestt])\n            {\n                longestt++;\n            }\n            else\n            {\n                break;\n            }\n        }\n      \n        return longestt - 1;\n    }\n};\n```
['Array', 'C', 'C++']