Easy Understandabe java Code~Trust me
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass OrderedStream {\n    String[] stream;\n    int ptr=0;\n\n\n    public OrderedStream(int n) {\n        stream=new String[n+1];\n        m=n;\n    }\n    public List<String> insert(int idKey, String value) {\n        List<String> list=new ArrayList<>();\n        stream[idKey-1]=value;\n        while(stream[ptr]!=null)\n        {\n            list.add(stream[ptr]);\n            ptr++;\n        }\n        return list;\n    }\n}\n\n/**\n * Your OrderedStream object will be instantiated and called as such:\n * OrderedStream obj = new OrderedStream(n);\n * List<String> param_1 = obj.insert(idKey,value);\n */\n```
['Java']