65ms Java faster than 100% w/Comments
If any question feel free to ask.\n\nclass OrderedStream {\n    String[] arr; //Stores the String values in the id\'th index.\n    int size; //size of orderedst
If any question feel free to ask.\n```\nclass OrderedStream {\n    String[] arr; //Stores the String values in the id\'th index.\n    int size; //size of orderedstream\n    int ptr; //pointer to hold current position\n    \n    public OrderedStream(int n) {\n        size = n;\n        arr = new String[size+1]; //size+1 cuz of id starts from 1.\n        ptr = 1; //it starts from 1 cuz of id is between 1 and n\n    }\n    \n    public List<String> insert(int id, String value) {\n        List<String> list = new ArrayList<>(); //local list to return.\n        arr[id] = value; //puts the string value to the index of id.\n\t\t\n\t\t//This loop iterates untill our pointer points null. While it is not null\n\t\t//It points value of pointer and add it to our List to return.\n        while(ptr<=size){\n             if(arr[ptr]==null)break;//If our pointer is null then we can break the loop.\n             list.add(arr[ptr++]);//If pointer is not null then add pointer value to list and increase the pointer for next values.\n        }\n\t\t\n        return list;\n    }   \n}\n```
['Java']