Java Solution
\nclass OrderedStream {\n    String[] arr;\n    int ptr;\n    public OrderedStream(int n) {\n        arr = new String[n];\n        ptr = 0;\n    }\n    \n    pu
```\nclass OrderedStream {\n    String[] arr;\n    int ptr;\n    public OrderedStream(int n) {\n        arr = new String[n];\n        ptr = 0;\n    }\n    \n    public List<String> insert(int idKey, String value) {\n        arr[idKey-1] = value;\n        List<String> list = new ArrayList<>();\n        while(ptr < arr.length && arr[ptr] != null){\n            list.add(arr[ptr++]);\n        }\n        return list;\n    }\n}\n```
['Java']