Java, faster than 100%. Understand the requirments is much harder than problem itself
\nclass OrderedStream {\n    \n    private String[] values;\n    private int ptr;\n\n    public OrderedStream(int n) {\n        values = new String[n];\n       
```\nclass OrderedStream {\n    \n    private String[] values;\n    private int ptr;\n\n    public OrderedStream(int n) {\n        values = new String[n];\n        ptr = 0;\n    }\n    \n    public List<String> insert(int id, String value) {\n        values[id - 1] = value;\n\n        List<String> result = new ArrayList();\n        while (ptr < values.length && values[ptr] != null) {\n            result.add(values[ptr++]);\n        }\n\n        return result;\n    }\n}\n```
['Java']