Easy Javascript Solution with array - max 731 ms
```\nclass LUPrefix{\n    constructor(n){\n        this.i = 0;\n        this.arr = new Array(n);\n        //console.log(this.arr);\n    }\n    / \n * @param {nu
```\nclass LUPrefix{\n    constructor(n){\n        this.i = 0;\n        this.arr = new Array(n);\n        //console.log(this.arr);\n    }\n    /** \n * @param {number} video\n * @return {void}\n */\n    upload = function(video) {\n        this.arr[video-1] = video;\n    }\n\n/**\n * @return {number}\n */\n    longest = function() {\n\n        for(;this.i<this.arr.length;this.i++){\n            if(!this.arr[this.i]){\n                return this.i;\n            }                 \n        }\n      return this.i;\n    }\n    \n};
[]