Post History
Python 3, 102 bytes def f(x,y): a=[x] for x in a: if y not in x:return x for i in range(len(x)+1):a+=[x[:i]+x[i+1:]] Try it online! Not exactly the most efficient, but it works. Ju...
Answer
#1: Initial revision
# [Python 3], 102 bytes <!-- language-all: lang-python --> <pre><code>def f(x,y): 	a=[x] 	for x in a: 		if y not in x:return x 		for i in range(len(x)+1):a+=[x[:i]+x[i+1:]] </code></pre> [Try it online!][TIO-lj36vdpa] [Python 3]: https://docs.python.org/3/ [TIO-lj36vdpa]: https://tio.run/##VY2xCsMwDETn@CtEJrsxoaWboV8SMiipnQhS2zguOF@fWrRLNRy6u4cUj7wGfz/Pp3XgZNGHMqLBx1BG0biQoAB5wJo15OAAHzIHxSSb36kutWCMOE3oFys362VR3U0Z7OqdwdDYlYG6mxnHk9mNvGU8xEpe@V9M5LN08sJVv@dEUap@jxtl2WpolVLnvGLWMGMWdq@62q9ZwytsYTk0BDHX4McgTjhNLBpYBf6Z31SL@AE "Python 3 – Try It Online" Not exactly the most efficient, but it works. Just a BFS of all possible removals.