Java 5 Lines Solution
\nprivate String[] values;\nprivate int i = 0;\n\npublic OrderedStream(int n) {\n\tvalues = new String[n];\n}\n\npublic List<String> insert(int idKey, String va
```\nprivate String[] values;\nprivate int i = 0;\n\npublic OrderedStream(int n) {\n\tvalues = new String[n];\n}\n\npublic List<String> insert(int idKey, String value) {\n\t// Below 5 lines do the magic\n\tvalues[idKey - 1] = value;   \n\tList<String> res = new ArrayList<>();\n\twhile (i < values.length && values[i] != null) {\n\t\tres.add(values[i]);\n\t\ti++;\n\t}\n\treturn res;\n}\n```
['Java']