Simple Solution in Java
\nclass OrderedStream {\n    private String[] s;\n    private int next;\n    public OrderedStream(int n) {\n        s=new String[n+1];\n        next=1;\n    }\n
```\nclass OrderedStream {\n    private String[] s;\n    private int next;\n    public OrderedStream(int n) {\n        s=new String[n+1];\n        next=1;\n    }\n    \n    public List<String> insert(int id, String value) {\n        s[id]=value;\n        List<String> tmp=new ArrayList<>();\n        if(id==next){\n            while(next<s.length && s[next]!=null){\n                tmp.add(s[next++]);\n            }\n                \n        }\n        return tmp;\n    }\n}\n```\nPlease **upvote**, if you like the solution:)
[]