Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
3 Saved 1 bytes thanks to @Shaggy
source | link

Javascript 7574 bytes

s=(a,b='')=>b=>~b.includessearch(a)?b:s(a,b+String.fromCharCode(32+Math.random()*95))

call like this:

s('hi')

Not sure if I should include s= when counting bytes, it is required for the recursion

Javascript 75 bytes

s=(a,b='')=>b.includes(a)?b:s(a,b+String.fromCharCode(32+Math.random()*95))

call like this:

s('hi')

Not sure if I should include s= when counting bytes, it is required for the recursion

Javascript 74 bytes

s=(a,b='')=>~b.search(a)?b:s(a,b+String.fromCharCode(32+Math.random()*95))

call like this:

s('hi')
2 Changed 94 to 95
source | link

Javascript 75 bytes

s=(a,b='')=>b.includes(a)?b:s(a,b+String.fromCharCode(32+Math.random()*94*95))

call like this:

s('hi')

Not sure if I should include s= when counting bytes, it is required for the recursion

Javascript 75 bytes

s=(a,b='')=>b.includes(a)?b:s(a,b+String.fromCharCode(32+Math.random()*94))

call like this:

s('hi')

Not sure if I should include s= when counting bytes, it is required for the recursion

Javascript 75 bytes

s=(a,b='')=>b.includes(a)?b:s(a,b+String.fromCharCode(32+Math.random()*95))

call like this:

s('hi')

Not sure if I should include s= when counting bytes, it is required for the recursion

1
source | link

Javascript 75 bytes

s=(a,b='')=>b.includes(a)?b:s(a,b+String.fromCharCode(32+Math.random()*94))

call like this:

s('hi')

Not sure if I should include s= when counting bytes, it is required for the recursion