K (ngn/k), 2323 16 bytes
-7 bytes by rereading question (specifically, "^
will only appear as ^H
")
{x_/3#-1+*(2'x)1+x?,"^H""^"}/
Feels a bit hacky; removesRemoves one instance of ?^H
on each invocation, and is run until convergence (i.e. no more ^H^
's are present).
{...}/
run function on (implicit) input until it converges(2'x)
take 2-length sliding windows of the input-1+*(...)1+x?,"^H""^"
get the index of the character immediately prior to the first^H^
inx
x_/3#
drop the value occurring at that index three times