Skip to main content
added 31 characters in body
Source Link
user81655
  • 11.3k
  • 1
  • 26
  • 53

JavaScript (V8), 5048 bytes

a=>f=s=>s[2]a=>f=b=>b[2]?s[[xb[[x,...r]=f(sb.slice(1)),1]<'b'1]<f?x:r:a

Try it online!Try it online!

-2 bytes thanks to @Arnauld!

JavaScript (V8), 50 bytes

a=>f=s=>s[2]?s[[x,...r]=f(s.slice(1)),1]<'b'?x:r:a

Try it online!

JavaScript (V8), 48 bytes

a=>f=b=>b[2]?b[[x,...r]=f(b.slice(1)),1]<f?x:r:a

Try it online!

-2 bytes thanks to @Arnauld!

Source Link
user81655
  • 11.3k
  • 1
  • 26
  • 53

JavaScript (V8), 50 bytes

a=>f=s=>s[2]?s[[x,...r]=f(s.slice(1)),1]<'b'?x:r:a

Try it online!