Java Array Solution
\nclass LUPrefix {\n    boolean[] array;\n    int maxSize;\n    public LUPrefix(int n) {\n        this.array = new boolean[n];\n        this.maxSize = 0;\n    }
```\nclass LUPrefix {\n    boolean[] array;\n    int maxSize;\n    public LUPrefix(int n) {\n        this.array = new boolean[n];\n        this.maxSize = 0;\n    }\n    public void upload(int video) {\n        array[video - 1] = true;\n        int count = 0;\n        for (int i = 0; i < array.length; i++) {\n            if (array[i] == true) {\n                count++;\n            } else {\n                maxSize = Math.max(maxSize, count);\n                break;\n            }\n        }\n        maxSize = Math.max(maxSize, count);\n    }\n    public int longest() {\n        return maxSize;\n    }\n}\n```
['Array', 'Java']