Easy Java Solution
```\nclass LUPrefix {\n    boolean[] uploaded;\n    int lPrefix = 0;\n\n    public LUPrefix(int n) {\n        uploaded = new boolean[n+1];\n    }\n    \n    pub
```\nclass LUPrefix {\n    boolean[] uploaded;\n    int lPrefix = 0;\n\n    public LUPrefix(int n) {\n        uploaded = new boolean[n+1];\n    }\n    \n    public void upload(int video) {\n        uploaded[video] = true;\n        for(int i=lPrefix+1; i<uploaded.length; i++) {\n            if(uploaded[i]) {\n                lPrefix++;\n            } else {\n                break;\n            }\n        }\n    }\n    \n    public int longest() {\n        return lPrefix;\n    }\n}\n
['Java']