TreeSet
\n/*\nWe will maintain a sorted set of un-uploaded videos.\nTo handle longest() query just return the first_element of the set -1\nFor uploading videos remove t
```\n/*\nWe will maintain a sorted set of un-uploaded videos.\nTo handle longest() query just return the first_element of the set -1\nFor uploading videos remove the video from the set\n*/\nclass LUPrefix {\n    TreeSet<Integer> set;\n    public LUPrefix(int n) {\n        this.set = new TreeSet<>();\n        for(int i=1;i<=n+1;i++) set.add(i);\n    }\n    public void upload(int video) {\n        set.remove(video);\n    }\n    public int longest() {\n        return set.first()-1;\n    }\n}\n\n\n```
[]