Post History
Haskell, 110 bytes f a=s>>=(#)$a++reverse a c@(a:b)!f=f c:b!f _!_=[] f#n=n!((n!).f) s(p:q)(d:e)(b:c)|e==c||e==[]=b|q==c=d|0<1=' ' Try it online!
Answer
#3: Post edited
- # [Haskell], 110 bytes
```- f a=s>>=(#)$a++reverse a
- c@(a:b)!f=f c:b!f
- _!_=[]
- f#n=n!((n!).f)
- s(p:q)(d:e)(b:c)|e==c||e==[]=b|q==c=d|0<1=' '
- ```
- [Try it online!][TIO-klcv5kbm]
- [Haskell]: https://www.haskell.org/
- [TIO-klcv5kbm]: https://tio.run/##Fc6xDoIwFEDRvV/xCiS0ITG6Nj7i6KCTIyGkLX3BCBUoOvXfKy43OdsddHi5cUyJQGOoaxS5LHRVre7r1uBAM3sRWhnJCQmsMpxYxztsWka5R8@F8FweSLIgZrVI0SsnhVFWRodo479NiyYuu7CPx/MJSyjTpJ8eECY932H@bI9tvXkogCC77jvvLP0A "Haskell – Try It Online"
- # [Haskell], 110 bytes
- ```haskell
- f a=s>>=(#)$a++reverse a
- c@(a:b)!f=f c:b!f
- _!_=[]
- f#n=n!((n!).f)
- s(p:q)(d:e)(b:c)|e==c||e==[]=b|q==c=d|0<1=' '
- ```
- [Try it online!][TIO-klcv5kbm]
- [Haskell]: https://www.haskell.org/
- [TIO-klcv5kbm]: https://tio.run/##Fc6xDoIwFEDRvV/xCiS0ITG6Nj7i6KCTIyGkLX3BCBUoOvXfKy43OdsddHi5cUyJQGOoaxS5LHRVre7r1uBAM3sRWhnJCQmsMpxYxztsWka5R8@F8FweSLIgZrVI0SsnhVFWRodo479NiyYuu7CPx/MJSyjTpJ8eECY932H@bI9tvXkogCC77jvvLP0A "Haskell – Try It Online"
#2: Post edited
- # [Haskell], 110 bytes
<!-- language-all: lang-hs -->f a=s>>=(#)$a++reverse ac@(a:b)!f=f c:b!f_!_=[]f#n=n!((n!).f)s(p:q)(d:e)(b:c)|e==c||e==[]=b|q==c=d|0<1=' '- [Try it online!][TIO-klcv5kbm]
- [Haskell]: https://www.haskell.org/
- [TIO-klcv5kbm]: https://tio.run/##Fc6xDoIwFEDRvV/xCiS0ITG6Nj7i6KCTIyGkLX3BCBUoOvXfKy43OdsddHi5cUyJQGOoaxS5LHRVre7r1uBAM3sRWhnJCQmsMpxYxztsWka5R8@F8FweSLIgZrVI0SsnhVFWRodo479NiyYuu7CPx/MJSyjTpJ8eECY932H@bI9tvXkogCC77jvvLP0A "Haskell – Try It Online"
- # [Haskell], 110 bytes
- ```
- f a=s>>=(#)$a++reverse a
- c@(a:b)!f=f c:b!f
- _!_=[]
- f#n=n!((n!).f)
- s(p:q)(d:e)(b:c)|e==c||e==[]=b|q==c=d|0<1=' '
- ```
- [Try it online!][TIO-klcv5kbm]
- [Haskell]: https://www.haskell.org/
- [TIO-klcv5kbm]: https://tio.run/##Fc6xDoIwFEDRvV/xCiS0ITG6Nj7i6KCTIyGkLX3BCBUoOvXfKy43OdsddHi5cUyJQGOoaxS5LHRVre7r1uBAM3sRWhnJCQmsMpxYxztsWka5R8@F8FweSLIgZrVI0SsnhVFWRodo479NiyYuu7CPx/MJSyjTpJ8eECY932H@bI9tvXkogCC77jvvLP0A "Haskell – Try It Online"
#1: Initial revision
# [Haskell], 110 bytes <!-- language-all: lang-hs --> f a=s>>=(#)$a++reverse a c@(a:b)!f=f c:b!f _!_=[] f#n=n!((n!).f) s(p:q)(d:e)(b:c)|e==c||e==[]=b|q==c=d|0<1=' ' [Try it online!][TIO-klcv5kbm] [Haskell]: https://www.haskell.org/ [TIO-klcv5kbm]: https://tio.run/##Fc6xDoIwFEDRvV/xCiS0ITG6Nj7i6KCTIyGkLX3BCBUoOvXfKy43OdsddHi5cUyJQGOoaxS5LHRVre7r1uBAM3sRWhnJCQmsMpxYxztsWka5R8@F8FweSLIgZrVI0SsnhVFWRodo479NiyYuu7CPx/MJSyjTpJ8eECY932H@bI9tvXkogCC77jvvLP0A "Haskell – Try It Online"