✅C++ || Easy to understand CODE || SHORT
\n\n\tclass LUPrefix {\n\t\tpublic:\n\t\t\tvector v;\n\t\t\tint it=0;\n\t\t\tLUPrefix(int n) {\n\t\t\t\tvector temp(n,-1);\n\t\t\t\tv=temp;\n\t\t\t}\n\n\t\t\tvo
![image](https://assets.leetcode.com/users/images/830cdb8a-b6c4-432c-a633-e6324e10421f_1664650348.5840409.png)\n\n\tclass LUPrefix {\n\t\tpublic:\n\t\t\tvector<int> v;\n\t\t\tint it=0;\n\t\t\tLUPrefix(int n) {\n\t\t\t\tvector<int> temp(n,-1);\n\t\t\t\tv=temp;\n\t\t\t}\n\n\t\t\tvoid upload(int video) {\n\t\t\t\tv[video-1]=1;\n\t\t\t\twhile(it<v.size()){\n\t\t\t\t\tif(v[it]==-1) break;\n\t\t\t\t\tit++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint longest() {\n\t\t\t\treturn it;\n\t\t\t}\n\t\t};
['C', 'C++']