very simple solution using bitarray
Intuition\nUse an array to keep the indexes of the videos that has been uploaded, and a variable llp (Last Longest Prefix) to keep the last longer prefix\n\n# A
# Intuition\nUse an array to keep the indexes of the videos that has been uploaded, and a variable llp (Last Longest Prefix) to keep the last longer prefix\n\n# Approach\nUse bit array to keep the indexes of the uploaded videos, and precalculate the LUP on each upload, this means to loop through the bit array until a non uploaded video is found. \n\n# Complexity\n- Time complexity:\n**Constructor**: $$O(1)$$\n**Upload**: $$O(1)$$\n**Longest**: $$O(1)$$\n\n- Space complexity:\n**Constructor**: $$O(n)$$, one bit per each __ith__ video\n**Upload**: $$O(1)$$\n**Longest**: $$O(1)$$\n\n# Code\n```\npublic class LUPrefix {\n  private int llp = 0;\n  private readonly BitArray b;\n  public LUPrefix(int n) => b = new(n);\n\n  public void Upload(int video) {\n    if(b[video - 1])\n      return;\n    b[video - 1] = true;\n    while(llp< b.Length && b[llp])\n      llp++;\n  }\n\n  public int Longest() => llp;\n}\n\n/**\n * Your LUPrefix object will be instantiated and called as such:\n * LUPrefix obj = new LUPrefix(n);\n * obj.Upload(video);\n * int param_2 = obj.Longest();\n */\n```
['Bit Manipulation', 'C#']