Skip to main content
saved 2 bytes
Source Link
Arnauld
  • 197.7k
  • 20
  • 179
  • 650

JavaScript (ES6), 69 69  67 bytes

Saved 2 bytes thanks to @Neil

f=s=>s<(s=s.replace(/\(.?([<>]{3})\).?/,(_,s)=>s[s[1]>'<'?2:0]))?f(s):s

Try it online!Try it online!

JavaScript (ES6), 69 bytes

f=s=>s<(s=s.replace(/\(?([<>]{3})\)?/,(_,s)=>s[s[1]>'<'?2:0]))?f(s):s

Try it online!

JavaScript (ES6),  69  67 bytes

Saved 2 bytes thanks to @Neil

f=s=>s<(s=s.replace(/.?([<>]{3}).?/,(_,s)=>s[s[1]>'<'?2:0]))?f(s):s

Try it online!

Source Link
Arnauld
  • 197.7k
  • 20
  • 179
  • 650

JavaScript (ES6), 69 bytes

f=s=>s<(s=s.replace(/\(?([<>]{3})\)?/,(_,s)=>s[s[1]>'<'?2:0]))?f(s):s

Try it online!