[Question]
  [
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](/questions/tagged/code-golf "show questions tagged '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'
```
  
[Answer]
## Haskell, ~~38~~ 33 bytes
```
s#i=take i s++drop(i+1)s
scanl(#)
```
Straight forward: repeatedly take the elements before and after index i, rejoin them and collect the results.
[Try it online!](https://tio.run/##dYuxDkAwGAZ3T/EFA2kHxNonEUOjxR/V4vf@xUgiN97drHmxzsXIGalTLxYEFsIcYStI1CUnu@JBe1dkZVw1eSiYkADbQf5Ejh3pEIydghtTdLVsbyrZ9L/Jv6nki0/4rPEC "Haskell – Try It Online")
Edit: @Lynn saved 5 bytes. Thanks!
[Answer]
# 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=>a=>[s+"",a.map(x=>s.splice(x,1)&&s+"")]
```
* 3 bytes saved thanks to [Arnauld](https://codegolf.stackexchange.com/users/58563/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=>a=>[s+"",a.map(x=>s.splice(x,1)&&s+"")]
)([...i.value="codegolf"])(j.value=[1,4,4,0,2]));oninput=_=>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;}
```
```
<label for=i>String: </label><input id=i><label for=j>Indices: </label><input id=j><pre id=o>
```
---
## 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.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 6 bytes
```
åjV uV
```
[Test it online!](http://ethproductions.github.io/japt/?v=1.4.5&code=5WpWIHVW&input=WzEsNCw0LDAsMl0gImNvZGVnb2xmIg==)
### Explanation
```
UåjV uV   Implicit: U = array of integers, V = string
Uå        Cumulatively reduce U by
  j         removing the item at that index in the previous value,
   V        with an initial value of V.
     uV   Push V to the beginning of the result.
```
Alternatively:
```
uQ åjV
UuQ       Push a quotation mark to the beginning of U.
    å     Cumulatively reduce by
     j      removing the item at that index in the previous value,
      V     with an initial value of V.
```
This works because removing the item at index `"` does nothing and so returns the original string.
[Answer]
## [Husk](https://github.com/barbuz/Husk), 7 bytes
```
G§+oh↑↓
```
Takes first the string, then (1-based) indices.
[Try it online!](https://tio.run/##yygtzv7/3/3Qcu38jEdtEx@1Tf7//79SYlJySmpaeobS/2gTHUMdIx2jWAA "Husk – Try It Online")
## Explanation
```
G§+oh↑↓
G        Scan from left by function:
           Arguments are string, say s = "abcde", and index, say i = 3.
      ↓    Drop i elements: "de"
     ↑     Take i elements
   oh      and drop the last one: "ab"
 §+        Concatenate: "abde"
         Implicitly print list of strings on separate lines.
```
[Answer]
# [Python 2](https://docs.python.org/2/), 43 bytes
```
s,i=input()
for i in i+[0]:print s;s.pop(i)
```
[Try it online!](https://tio.run/##PcrBCoAgEATQe1@xN5WWsOhU9CXiqbIWQpe0Q19vGBEMb2AYvtMefJdzRJrI85Wkqlw4gYA8UG20HfgknyCOseHAklR28nvi1yobI2aBIEJhKayF7d@OghMWwbQI/RuN0Fn7AA "Python 2 – Try It Online")
> 
> Any form of output is fine as long as it is easily readable.
> 
> 
> 
So this prints as lists of chars.
[Answer]
# [Python 2](https://docs.python.org/2/), 47 bytes
This could be shortened to [43 bytes](https://tio.run/##K6gsycjPM/r/P1EnyTYzr6C0REOTKy2/SCFTITNPIUk72iDWqqAoM69EIdE6Ua8gv0AjU/P//2ilZCUdpXwgTgHiVCBOh/JzgDhNKVZHIdpQR8EEjAx0FIxiAQ), as @LuisMendo pointed out, but that's already @ErktheOutgolfer's solution.
```
a,b=input();print a
for i in b:a.pop(i);print a
```
[Try it online!](https://tio.run/##K6gsycjPM/r/P1EnyTYzr6C0REPTuqAoM69EIZErLb9IIVMhM08hySpRryC/QCMTLvf/f7RSspKOUj4QpwBxKhCnQ/k5QJymFKujEG2oo2ACRgY6CkaxAA "Python 2 – Try It Online")
[Answer]
# Java 8, 78 bytes
This is a curried lambda, from `int[]` to a consumer of [`StringBuilder`](https://docs.oracle.com/javase/8/docs/api/index.html?java/lang/StringBuilder.html) or [`StringBuffer`](https://docs.oracle.com/javase/8/docs/api/index.html?java/lang/StringBuffer.html). Output is printed to standard out.
```
l->s->{System.out.println(s);for(int i:l)System.out.println(s.delete(i,i+1));}
```
[Try It Online](https://tio.run/##bY8xT8MwEIXn9lecOsUisShiIiUDIDamjlUH4zjRpY5t2eegKspvD27aBVHphne6907v68QgCuuU6erT7OK3RglSixDgS6CBcb1yHgdBCgIJSscuBXgk1LyJRhJawz9vYrcnj6Z9i6hr5fN71ndrQuyV36Ghw7GqIH039IFBOKfEJQ2vcygqXVTj/hxI9dxG4otLmyywsrE@Swvgi2b3HLxWWpHKMMeHLWPlNK/KBHEluzEMFmvoE192bXw4gvBtYBfc1b9GPCl9zoz6gT@A2UbaWrVWNxvGuJBSOVpcCxuM2xyel3nM4WliqcW0nuZf)
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 11 bytes
```
v=ā0m0yǝÏ},
```
[Try it online!](https://tio.run/##MzBNTDJM/f@/zPZIo0GuQeXxuYf7a3X@/4821DEBQgMdo1iuaKVkJR2lfCBOAeJUIE6H8nOAOE0pFgA "05AB1E – Try It Online")
```
v           # For each index:
 =          #   Print without popping
  ā         #   Push range(1, len(a) + 1)
   0m       #   Raise each to the power of 0. 
            #   This gives a list of equal length containing all 1s
     0yǝ    #   Put a 0 at the location that we want to remove
        Ï   #   Keep only the characters that correspond to a 1 in the new list
         }, # Print the last step
```
[Answer]
# Mathematica, 70 bytes
```
(s=#;For[t=1,t<=Length@#2,Print@s;s=StringDrop[s,{#2[[t]]+1}];t++];s)&
```
[Try it online!](https://tio.run/##y00sychMLv6fZvtfo9hW2dotvyi6xNZQp8TG1ic1L70kw0HZSCegKDOvxKHYutg2uATITHcpyi@ILtapVjaKji6JjdU2rI21LtHWjrUu1lT7D1as4JAWrZScn5Kanp@TpqSjUG2oYwKEBjpGtbH/AQ "Mathics – Try It Online")
[Answer]
# [R](https://www.r-project.org/), ~~46~~ 32 bytes
```
function(S,X)Reduce(`[`,-X,S,,T)
```
[Try it online!](https://tio.run/##DcgxCoAwDAXQ3WNkSuA7qDh6CesglEKhNiKIFW3PX@Vt76k6VS1XyEe62GCVOW4lRPbWo11hgEWq8puf9z6PzBTSFvd0KoFIrO2cQ@Ae46/DINIoE/0lUj8 "R – Try It Online")
Takes input as a list of characters and `X` is 1-based. `Reduce` is the R equivalent of `fold`, the function in this case is `[` which is subset. Iterates over `-X` because negative indexing in R removes the element, and `init` is set to `S`, with `accum=TRUE` so we accumulate the intermediate results.
# [R](https://www.r-project.org/), 80 bytes
```
function(S,X,g=substring)Reduce(function(s,i)paste0(g(s,0,i-1),g(s,i+1)),X,S,,T)
```
2-argument function, takes `X` 1-indexed. Takes `S` as a string.
[Try it online!](https://tio.run/##PYuxDoUgEAT/xeou7ktEY@lPPC1sFYFcYsAIfD9iY7aZyWTvYqdis9dJgqcZK9wU8x7TLd7x3xxZG/p6hPC1xWQ6clU6yE8xXpRWMdf3DCxcLDU6HMaF0zbQ1GOsUxiYywM "R – Try It Online")
[Answer]
# [Haskell](https://www.haskell.org/), 33 bytes
```
scanl(\s i->take i s++drop(i+1)s)
```
[Try it online!](https://tio.run/##DcJLCoAgFAXQrVykgWJBRtPaSDUQP/XINHrt3@Kcw/IZUqo1TuxsTnJlUDe/9gwgsNb@KbckbRSrelnKmHA/lF80iBCu@LCXFAUW046/vh22@gE "Haskell – Try It Online")
[Answer]
# q/kdb+, ~~27~~ 10 bytes
**Solution:**
```
{x _\0N,y}
```
**Examples:**
```
q){x _\0N,y}["codegolf";1 4 4 0 2]
"codegolf"
"cdegolf"
"cdeglf"
"cdegf"
"degf"
"def"
q){x _\0N,y}["abc";0]
"abc"
"bc"
q){x _\0N,y}["abc";()]
"abc"
q){x _\0N,y}["abc";2 0 0]
"abc"
"ab"
,"b"
""    
q){x _\0N,y}["";()]
""
```
**Explanation:**
Takes advantage of the [converge](https://code.kx.com/q/ref/adverbs/#converge-iterate) functionality `\` as well as drop `_`.
```
{x _\0N,y}
{        } / lambda function, x and y are implicit variables
     0N,y  / join null to the front of list (y), drop null does nothing
   _\      / drop over (until result converges) printing each stage
 x         / the string (need the space as x_ could be a variable name)
```
**Notes:**
If we didn't need to print the original result, this would be **2** bytes in `q`:
```
q)_\["codegolfing";10 9 8 3 2 1 0]
"codegolfin"
"codegolfi"
"codegolf"
"codgolf"
"cogolf"
"cgolf"
"golf"
```
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), ~~94~~ 84 bytes
```
param($s,$x)$a=[Collections.Generic.list[char]]$s;$x|%{-join$a;,$a|% r*t $_};-join$a
```
[Try it online!](https://tio.run/##LchBCsIwEADAr@xhS1tZS6sXJQiCBx9RioQY28ialCRgwfr29eIcZw5vG9NkmUVmHfWrwkS41KhP/SUwW5Nd8Km5Wm@jMw27lHsz6TgMmBQua/HZPoPzqBWhXguImwx4@6r/ikhpwt2OgR/Oj6Wcq64lOBIcCPYEO4KOoK1/ "PowerShell – Try It Online")
Takes input `$s` as a string and `$x` as an explicit array. We then create `$a` based on `$s` as a list.
Arrays in PowerShell are fixed size (for our purposes here), so we need to use the lengthy `[System.Collections.Generic.list]` type in order to get access to the `.removeAt()` function, which does exactly what it says on the tin.
I sacrificed 10 bytes to include two `-join` statements to make the output pretty. OP has stated that outputting a list of chars is fine, so I could output just `$a` rather than `-join$a`, but that's really ugly in my opinion.
*Saved 10 bytes thanks to briantist.*
[Answer]
# [Python 2](https://docs.python.org/2/), 50 bytes
* Takes in string and list of indices
```
s,i=input()
for j in i+[0]:print s;s=s[:j]+s[j+1:]
```
[Try it online!](https://tio.run/##HcKxCoAgEADQva@4zUKHlCbDLzmcKuskVDwb@nqDHq@87crJ9M6KHKXytHEaQq4QgRKQxNnbUik14JUdo41eMkapre9dbHk/znwHoVArWP6zAuM/ "Python 2 – Try It Online")
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 99 bytes
```
j;f(s,a,i)char*s;int*a;{puts(s);for(j=0;j<i;j++){memmove(s+a[j],s+a[j]+1,strlen(s)-a[j]);puts(s);}}
```
[Try it online!](https://tio.run/##NY7NCsMgEIRfRXLSuIGktKdtniTkINakSozFtb1Int0m/YGBgYFvZnQza12Kw4kTKLBC31WsCe2aaoX58UzESeAUInd9i@5q0Ukpsjfeh5fhJNXgRvia7IBSXMy6I80RCPwXbFvxyq5c5GOA0TD2lQ43M4dlqo41pvYod8DOH7XATtvv1GXHyxs "C (gcc) – Try It Online")
Takes the string, array, and the length of the array.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~9~~ 7 bytes
```
=svõyǝ=
```
[Try it online!](https://tio.run/##MzBNTDJM/f/ftrjs8NbK43Nt//9Pzk9JTc/PSeOKNtQxAUIDHaNYAA "05AB1E – Try It Online")
---
```
=s        # Print original string, swap with indices.
  v       # Loop through indices...
   õyǝ    # Replace current index with empty string.
```
-2 thanks to idea from @ETHProductions.
[Answer]
# [Retina](https://github.com/m-ender/retina), 58 bytes
```
¶\d+
¶¶1$&$*
+1`(?=.*¶¶.(.)*)(((?<-1>.)*).(.*)¶)¶.*
$2$3$4
```
[Try it online!](https://tio.run/##K0otycxL/P//0LaYFG2uQ9sObTNUUVPR4tI2TNCwt9XTAonoaehpamlqaGjY2@ga2oHYQBEtzUPbgEhPi0vFSMVYxeT//@T8lNT0/Jy0zLx0LkMDLksuCy5jLiMuQy4DAA "Retina – Try It Online") Explanation:
```
¶\d+
```
Match the indices (which are never on the first line, so are always preceded by a newline).
```
¶¶1$&$*
```
Double-space the indices, convert to unary, and add 1 (because zeros are hard in Retina).
```
+1`
```
Repeatedly change the first match, which is always the current value of the string.
```
   (?=.*¶¶.(.)*)
```
Retrieve the next index in `$#1`.
```
                (           .    ¶)
```
Capture the string, including the `$#1`th character and one newline.
```
                 ((?<-1>.)*) (.*)
```
Separately capture the prefix and suffix of the `$#1`th character of the string.
```
                                   ¶.*
```
Match the index.
```
$2$3$4
```
Replace the string with itself and the index with the prefix and suffix of the `$#1`th character.
[Answer]
# Pyth, 8 bytes
```
.u.DNYEz
```
[Demonstration](https://pyth.herokuapp.com/?code=.u.DNYEz&input=codegolf%0A%5B1%2C+4%2C+4%2C+0%2C+2%5D&debug=0)
Reduce, starting with the string and iterating over the list of indices, on the deletion function.
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), ~~54~~ 58 bytes
```
param($s,$x),-1+$x|%{$z=$_;$i=0;-join($s=$s|?{$z-ne$i++})}
```
[Try it online!](https://tio.run/##DcnRCsIgFADQX7kPN6Z4Ba2XYkj9xxghyzbDdOhDo7Zvt53XM6ePy2VyIdQ622zfDAvhwklqgct6@OHX4L1Fb1QrX8nH/Q2W9bqHjA69EBvfaq2sGyabu75vhvRwYwpPH8eG1xvTiuBCcCY4ERwJNIHifw "PowerShell – Try It Online")
## Explanation
Takes input as a char array (`[char[]]`).
Iterates through the array of indices (`$x`) plus an injected first element of `-1`, then for each one, assigns the current element to `$z`, initializes `$i` to `0`, then iterates through the array of characters (`$s`), returning a new array of only the characters whose index (`$i`) does not equal (`-ne`) the current index to exclude (`$z`). This new array is assigned back to `$s`, while simultaneously being returned (this happens when the assignment is done in parentheses). That returned result is `-join`ed to form a string which is sent out to the pipeline.
Injecting `-1` at the beginning ensures that the original string will be printed, since it's the first element and an index will never match `-1`.
[Answer]
# [Perl 5](https://www.perl.org/), 55 bytes (54 + "`-l`")
```
sub{print($s=shift);for(@_){substr$s,$_,1,"";print$s}}
```
[Try it online!](https://tio.run/##dY7NCoMwEAbveYol5GBgA9ofaAmWvolUa2xAjGTTk/jqTdPQ3irs6ZuB2bn34zEKAzVEerbL7O0UCkE1PawJUhvni2sjl8QoeEEoGqyQc51FQesaNWPCqEvBO3fvBzcajlAhHPKVCDupWbaBK6W4/tq3tktiuQ3/k43517bT8Mmn7BnhhLBP/fxOCsWXm4N1E0U1vgE "Perl 5 – Try It Online")
[Answer]
# [MATL](https://github.com/lmendo/MATL), 8 bytes
```
ii"t[]@(
```
Indexing is 1-based.
[Try it online!](https://tio.run/##y00syfn/PzNTqSQ61kHj/3/15PyU1PT8nDR1rmgjHQVTMDLUUTCOBQA "MATL – Try It Online") Or [verify the test cases](https://tio.run/##y00syfmf8D8zU6kkOtZB43@suq6urnqES8h/9cSkZHWuaMNYLigLzjDWUTAEIiAfJAoA).
### Explanation
```
i      % Input string. Input has to be done explicitly so that the string
       % will be displayed even if the row vector of indices is empty
i      % Input row vector of indices
"      % For each
  t    %   Duplicate current string
  []   %   Push empty array
  @    %   Push current index
  (    %   Assignment indexing: write [] to string at specified index
       % End (implicit). Display stack (implicit)
```
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), ~~87~~ ~~87~~ ~~74~~ 70 bytes
```
S=>I=>{for(int i=0;;S=S.Remove(I[i++],1))System.Console.WriteLine(S);}
```
[Try it online!](https://tio.run/##XY5BS8NAFITv@yuWnnbpNiR6UbYJiMVS0It78BByCNvX8iB5W/dtWyTkt8coKCJzmoGZbzyvfIgwnRnpKN0HJ@it@OuyZ6T3f9Fj6DrwCQNxtgWCiN4KanvgU@tB0iB81zLL0yA4tQm9fDqTX3OK84h5@G6ukVLdVJXcyHJyZbUrq@EQoppjiWVurStd9gp9uIDa1bhcNqbQ@vcAcegge4uYYD4Iymk7TvYHdwm4ly8tktKD2KiFD3s4hu4w4xdaEVzrZihyc2/uzK25MYXJR23F@KXpEw "C# (.NET Core) – Try It Online")
Just goes to show that recursion isn't always the best solution. This is actually shorter than my original invalid answer. Still prints to STDOUT rather than returning, which is necessary because it ends with an error.
-4 bytes thanks to TheLethalCoder
[Answer]
# [J](http://jsoftware.com/), 23 bytes
```
>@({&.>/\.&.|.@;<^:4"0)
```
[Try it online!](https://tio.run/##y/qfVqxga6VgoADE/@0cNKrV9Oz0Y/TU9Gr0HKxt4qxMlAw0/2tyKekpqKfZWqkr6CjUWimkFXNxpSZn5CuoJ@enpKbn56SpK6QpGCqYAKGBgtF/AA "J – Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `o`, 4 bytes
```
(…n⟇
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJvIiwiIiwiKOKApm7in4ciLCIiLCJbMSwgNCwgNCwgMCwgMl1cbltcImNcIiwgXCJvXCIsIFwiZFwiLCBcImVcIiwgXCJnXCIsIFwib1wiLCBcImxcIiwgXCJmXCJdIl0=)
Prints lists of chars
```
(…n⟇ # 'o' flag forces output of the last value
(    # For every number in the list...
 …   # Print the string without popping
  n  # Get the current value
   ⟇ # Remove the char at the index
     # The result is printed on next iteration
```
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), 10 bytes
Rule changes saved me 1 byte:
```
V+E0Q .(QN
```
[Try it online!](https://tio.run/##K6gsyfj/P0zb1SBQQU8j0O///2ilZCUdpXwgTgHiVCBOh/JzgDhNKZYr2lBHwQSMDHQUjGIB "Pyth – Try It Online")
# [Pyth](https://pyth.readthedocs.io), 11 bytes
```
V+E0sQ .(QN
```
**[Try it online!](https://tio.run/##K6gsyfj/P0zb1aA4UEFPI9Dv//9opWQlHaV8IE4B4lQgTofyc4A4TSmWK9pQR8EEjAx0FIxiAQ)**
[Answer]
# [Gaia](https://github.com/splcurran/Gaia), 9 bytes
```
+⟪Seḥ+⟫⊣ṣ
```
I should really add a "delete at index" function...
[Try it online!](https://tio.run/##S0/MTPz/X/vR/FXBqQ93LAUyVj/qWvxw5@L/qY/aOxSA4FHDHOfEnByFkoxUhbTSvOSSzPw8BSAC8TPzCkpLHjXMjfkPVJWcn5Kanp@TBuQrRBsqmAChgYJRLAA "Gaia – Try It Online")
### Explanation
```
+          Add the string to the list
 ⟪Seḥ+⟫⊣   Cumulatively reduce by this block:
  S         Split around index n
   e        Dump the list
    ḥ       Remove the first char of the second part
     +      Concatenate back together
        ṣ  Join the result with newlines
```
[Answer]
# [V](https://github.com/DJMcMayhem/V), 12 bytes
```
òdt,GÙ@-|xHx
```
[Try it online!](https://tio.run/##K/v///CmlBId98MzHXRrKjwq/v83NNQxNNCx1DHRMdYx0jHU4UrOT0lNz89Jy8xLBwA "V – Try It Online")
This is 1-indexed, input is like:
```
11,10,9,4,3,2,1,
codegolfing
```
### Explanation
```
ò              ' <M-r>ecursively until error
 dt,           ' (d)elete (t)o the next , (errors when no more commas)
    G          ' (G)oto the last line
     Ù         ' Duplicate it down
        |      ' Goto column ...
      @-       ' (deleted number from the short register)
         x     ' And delete the character there
          H    ' Go back home
           x   ' And delete the comma that I missed
```
[Answer]
# [Swift 3](https://www.swift.org), 80 bytes
```
func f(l:[String],c:[Int]){var t=l;for i in c{print(t);t.remove(at:i)};print(t)}
```
**[Try it online!](http://swift.sandbox.bluemix.net/#/repl/598df3ef19b65f016ddd76f4)**
[Answer]
# Pyth, 8 bytes
```
+zm=z.Dz
```
[Test suite!](https://pyth.herokuapp.com/?code=%2Bzm%3Dz.Dz&input=%22codegolf%22%0A%5B1%2C+4%2C+4%2C+0%2C+2%5D&test_suite=1&test_suite_input=%5B1%2C+4%2C+4%2C+0%2C+2%5D%0Acodegolf%0A%5B0%5D%0Aabc%0A%5B%5D%0Aabc%0A%5B2%2C+0%2C+0%5D%0Aabc%0A%5B%5D%0A%0A%5B10%2C+9%2C+8%2C+3%2C+2%2C+1%2C+0%5D%0Acodegolfing%0A&debug=0&input_size=2)
# explanation
```
+zm=z.DzdQ    # implicit: input and iteration variable
  m      Q    # for each of the elements of the first input (the array of numbers, Q)
     .Dzd     # remove that index from the second input (the string, z)
   =z         # Store that new value in z
+z            # prepend the starting value
```
[Answer]
# [Python 2](https://tio.run/#python2), 54
```
X,S=input()
for a in X:
    print S
    S=S[:a]+S[a+1:]
print S
```
[Try It Online](https://tio.run/##K6gsycjPM/r/P0In2DYzr6C0REOTKy2/SCFRITNPIcKKizPYNjjaKjFWOzg6UdvQKparoCgzr0Qh@P//aEMdBRMwMtBRMIrVUU/OT0lNz89JUwcA)
]