Skip to main content
added 59 characters in body
Source Link
tsh
  • 35.6k
  • 2
  • 34
  • 129

JavaScript, 86 8282 77 bytes

x=>([s,a=0,b=a,c,d,e,f]=x,f?x:e?x+e:d?s+a+d+b+d+c+d:[s,a,d||a,c?s+a+a+b+b+c+cb:s+a+a+a+b+b+ba,d||b,v=c||b,d||v].join``)

just find out that remove recursive save 4 bytes...

idea from @Arnauld save 4 bytes, +1 more bytes

JavaScript, 86 82 bytes

x=>([s,a=0,b=a,c,d,e,f]=x,f?x:e?x+e:d?s+a+d+b+d+c+d:c?s+a+a+b+b+c+c:s+a+a+a+b+b+b)

just find out that remove recursive save 4 bytes...

JavaScript, 86 82 77 bytes

x=>([s,a=0,b=a,c,d,e,f]=x,f?x:e?x+e:[s,a,d||a,c?b:a,d||b,v=c||b,d||v].join``)

just find out that remove recursive save 4 bytes...

idea from @Arnauld save 4 bytes, +1 more bytes

added 56 characters in body
Source Link
tsh
  • 35.6k
  • 2
  • 34
  • 129

JavaScript, 86 8382 bytes

p=x=>x=>([s,a=0,b=a,c,d,e,f]=x,f?x:e?x+e:d?s+a+d+b+d+c+d:c?s+a+a+b+b+c+c:p(s+a+a+a+b)s+a+a+a+b+b+b)

just find out that remove recursive save 4 bytes...

JavaScript, 86 83 bytes

p=x=>([s,a=0,b=a,c,d,e,f]=x,f?x:e?x+e:d?s+a+d+b+d+c+d:c?s+a+a+b+b+c+c:p(s+a+a+a+b))

JavaScript, 86 82 bytes

x=>([s,a=0,b=a,c,d,e,f]=x,f?x:e?x+e:d?s+a+d+b+d+c+d:c?s+a+a+b+b+c+c:s+a+a+a+b+b+b)

just find out that remove recursive save 4 bytes...

added 11 characters in body
Source Link
tsh
  • 35.6k
  • 2
  • 34
  • 129

JavaScript, 8686 83 bytes

p=x=>([s,a=0,b=a,c,d,e,f]=x,f?x:e?x+e:d?p(s+a+d+b+d+c+d):c?s+a+a+b+b+c+c:p(s+a+a+a+b))

JavaScript, 86 bytes

p=x=>([s,a=0,b=a,c,d,e,f]=x,f?x:e?x+e:d?p(s+a+d+b+d+c+d):c?s+a+a+b+b+c+c:p(s+a+a+a+b))

JavaScript, 86 83 bytes

p=x=>([s,a=0,b=a,c,d,e,f]=x,f?x:e?x+e:d?s+a+d+b+d+c+d:c?s+a+a+b+b+c+c:p(s+a+a+a+b))
Source Link
tsh
  • 35.6k
  • 2
  • 34
  • 129
Loading