Skip to main content
another one bytes the dust
Source Link
Wheat Wizard
  • 102.8k
  • 23
  • 299
  • 697

Haskell, 109 104 98 97 90 8484 83 bytes

Probably not very good but Hopefully this will kick things off a bit.

f s=[[x|x<-map(`take`a`take`(a++"$"))[0..],[1]==[1|d<-s,and$zipWith(==)x d]]x$d++"$"]]!!0|a<-s]
f.map(++"$")

Try it online!Try it online!

Haskell, 109 104 98 97 90 84 bytes

Probably not very good but Hopefully this will kick things off a bit.

f s=[[x|x<-map(`take`a)[0..],[1]==[1|d<-s,and$zipWith(==)x d]]!!0|a<-s]
f.map(++"$")

Try it online!

Haskell, 109 104 98 97 90 84 83 bytes

Probably not very good but Hopefully this will kick things off a bit.

f s=[[x|x<-map(`take`(a++"$"))[0..],[1]==[1|d<-s,and$zipWith(==)x$d++"$"]]!!0|a<-s]

Try it online!

added 38 characters in body
Source Link
Wheat Wizard
  • 102.8k
  • 23
  • 299
  • 697

Haskell, 109 104 98 9797 90 84 bytes

Probably not very good but Hopefully this will kick things off a bit.

a!s=[1]==[1|x<-s,and$zipWith(==)af x]
a#s=[x|x<s=[[x|x<-map(`take`a)[0..],[1]==[1|d<-s,and$zipWith(==)x!s] d]]!!0
f s=map(#s)s0|a<-s]
f.map(++"$")

Try it online!

Explanation

We define a couple of functions here. The first (!) is a predicate that determines that there is exactly 1 string in a list starting with a substring.

After that we have (#) which will take a string and a list and determine the shortest substring of a particular string that returns true for our predicate (!).

We then define a function f that maps (#) to each item in a list with respects to that list. Our final function is just this, but we compose it with map(++"$") to get the $ behavior required.Try it online!

Haskell, 109 104 98 97 bytes

Probably not very good but Hopefully this will kick things off a bit.

a!s=[1]==[1|x<-s,and$zipWith(==)a x]
a#s=[x|x<-map(`take`a)[0..],x!s]!!0
f s=map(#s)s
f.map(++"$")

Try it online!

Explanation

We define a couple of functions here. The first (!) is a predicate that determines that there is exactly 1 string in a list starting with a substring.

After that we have (#) which will take a string and a list and determine the shortest substring of a particular string that returns true for our predicate (!).

We then define a function f that maps (#) to each item in a list with respects to that list. Our final function is just this, but we compose it with map(++"$") to get the $ behavior required.

Haskell, 109 104 98 97 90 84 bytes

Probably not very good but Hopefully this will kick things off a bit.

f s=[[x|x<-map(`take`a)[0..],[1]==[1|d<-s,and$zipWith(==)x d]]!!0|a<-s]
f.map(++"$")

Try it online!

byte off
Source Link
Wheat Wizard
  • 102.8k
  • 23
  • 299
  • 697

Haskell, 109 104 9898 97 bytes

Probably not very good but Hopefully this will kick things off a bit.

a!s=2>sum[1|x<s=[1]==[1|x<-s,and$zipWith(==)a x]
a#s=[x|x<-map(`take`a)[0..],x!s]!!0
f s=map(#s)s
f.map(++"$")

Try it online!Try it online!

Explanation

We define a couple of functions here. The first (!) is a predicate that determines that there is exactly 1 string in a list starting with a substring.

After that we have (#) which will take a string and a list and determine the shortest substring of a particular string that returns true for our predicate (!).

We then define a function f that maps (#) to each item in a list with respects to that list. Our final function is just this, but we compose it with map(++"$") to get the $ behavior required.

Haskell, 109 104 98 bytes

Probably not very good but Hopefully this will kick things off a bit.

a!s=2>sum[1|x<-s,and$zipWith(==)a x]
a#s=[x|x<-map(`take`a)[0..],x!s]!!0
f s=map(#s)s

Try it online!

Explanation

We define a couple of functions here. The first (!) is a predicate that determines that there is exactly 1 string in a list starting with a substring.

After that we have (#) which will take a string and a list and determine the shortest substring of a particular string that returns true for our predicate (!).

We then define a function f that maps (#) to each item in a list with respects to that list. Our final function is just this, but we compose it with map(++"$") to get the $ behavior required.

Haskell, 109 104 98 97 bytes

Probably not very good but Hopefully this will kick things off a bit.

a!s=[1]==[1|x<-s,and$zipWith(==)a x]
a#s=[x|x<-map(`take`a)[0..],x!s]!!0
f s=map(#s)s
f.map(++"$")

Try it online!

Explanation

We define a couple of functions here. The first (!) is a predicate that determines that there is exactly 1 string in a list starting with a substring.

After that we have (#) which will take a string and a list and determine the shortest substring of a particular string that returns true for our predicate (!).

We then define a function f that maps (#) to each item in a list with respects to that list. Our final function is just this, but we compose it with map(++"$") to get the $ behavior required.

deleted 1 character in body
Source Link
Wheat Wizard
  • 102.8k
  • 23
  • 299
  • 697
Loading
added 14 characters in body
Source Link
Wheat Wizard
  • 102.8k
  • 23
  • 299
  • 697
Loading
Source Link
Wheat Wizard
  • 102.8k
  • 23
  • 299
  • 697
Loading