Disappearing Elements Given a string S and a list of indices X, modify S by removing the element at each index of S while using that result as the new value of S.

For example, given S = 'codegolf' and X = [1, 4, 4, 0, 2],

0 1 2 3 4 5 6 7  |
c o d e g o l f  |  Remove 1
c d e g o l f    |  Remove 4
c d e g l f      |  Remove 4
c d e g f        |  Remove 0
d e g f          |  Remove 2
d e f


Your task is to perform this process, collect the values of S after each operation, and display each on a newline in order. The final answer would be

S = 'codegolf'
X = [1, 4, 4, 0, 2]

Answer:

codegolf
cdegolf
cdeglf
cdegf
degf
def



This is code-golf so make your code as short as possible.
You may assume that the values in X are always valid indices for S, and you may use either 0-based or 1-based indexing.
The string will only contain [A-Za-z0-9]
Either S or x may by empty. If S is empty, it follows that x must also be empty.
You may also take S as a list of characters instead of a string.
You may either print the output or return a list of strings. Leading and trailing whitespace is acceptable. Any form of output is fine as long as it is easily readable.


Test Cases

S = 'abc', x = [0]
'abc'
'bc'

S = 'abc', x = []
'abc'

S = 'abc', x = [2, 0, 0]
'abc'
'ab'
'b'
''

S = '', x = []
''

S = 'codegolfing', x = [10, 9, 8, 3, 2, 1, 0]
'codegolfing'
'codegolfin'
'codegolfi'
'codegolf'
'codgolf'
'cogolf'
'cgolf'
'golf'
JavaScript (ES6), 57 50 48 45 42 bytes
Takes the string as an array of individual characters, outputs an array containing a comma separated string of the original followed by a subarray of comma separated strings for each step.
s=&gt;a=&gt;[s+&quot;&quot;,a.map(x=&gt;s.splice(x,1)&amp;&amp;s+&quot;&quot;)]


3 bytes saved thanks to Arnauld
suggesting I abuse the loose output spec more than I already was, which led me to abusing it even more for another 3 byte saving.


Test it


o.innerText=JSON.stringify((f=

s=&gt;a=&gt;[s+"",a.map(x=&gt;s.splice(x,1)&amp;&amp;s+"")]

)([...i.value="codegolf"])(j.value=[1,4,4,0,2]));oninput=_=&gt;o.innerText=JSON.stringify(f([...i.value])(j.value.split`,`))
label,input{font-family:sans-serif;font-size:14px;height:20px;line-height:20px;vertical-align:middle}input{margin:0 5px 0 0;width:100px;}
&lt;label for=i&gt;String: &lt;/label&gt;&lt;input id=i&gt;&lt;label for=j&gt;Indices: &lt;/label&gt;&lt;input id=j&gt;&lt;pre id=o&gt;




Explanation
We take the two inputs via parameters s (the string array) and a (the integer array) in currying syntax, meaning we call the function with f(s)(a).
We build a new array and start it off with the original s. However, as the splice method we'll be using later on modifies an array, we need to make a copy of it, which we can do by converting it to a string (simply append an empty string).
To generate the subarray, we map over the integer array a (where x is the current integer) and, for each element, we splice 1 element from s, beginning at index x. We return the modified s, again making a copy of it by converting it to a string.