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

JavaScript (Node.js), 5550 bytes

f=f=a=>a[1]?f(a,b=a.replace(/\((.>)?(.)(<.)?\)/,'$2'))=>a<b?f(b):ba

Try it online!Try it online!

Repeat apply regex replace until no match foundonly 1 char left. The regex /\((.>)?(.)(<.)?\)/ get the calculate result as 2nd capturing group.


Save 1 byte, thanks to Arnauld

JavaScript (Node.js), 55 bytes

f=(a,b=a.replace(/\((.>)?(.)(<.)?\)/,'$2'))=>a<b?f(b):b

Try it online!

Repeat apply regex replace until no match found. The regex /\((.>)?(.)(<.)?\)/ get the calculate result as 2nd capturing group.


Save 1 byte, thanks to Arnauld

JavaScript (Node.js), 50 bytes

f=a=>a[1]?f(a.replace(/\((.>)?(.)(<.)?\)/,'$2')):a

Try it online!

Repeat apply regex replace until only 1 char left. The regex /\((.>)?(.)(<.)?\)/ get the calculate result as 2nd capturing group.


Save 1 byte, thanks to Arnauld

deleted 10 characters in body
Source Link
tsh
  • 35.6k
  • 2
  • 34
  • 129

JavaScript (Node.js), 55 bytes

f=(a,b=a.replace(/\((.>)?(.)(<.)?\)/,'$2'))=>a<b?f(b):b

Try it online!

Repeat apply regex replace until no match found. The regex /\((.>)?(.)(<.)?\)/ get the calculate result as 2nd capturing group.


Save 1 byte, thanks to Arnauld

JavaScript (Node.js), 55 bytes

f=(a,b=a.replace(/\((.>)?(.)(<.)?\)/,'$2'))=>a<b?f(b):b

Try it online!


Save 1 byte, thanks to Arnauld

JavaScript (Node.js), 55 bytes

f=(a,b=a.replace(/\((.>)?(.)(<.)?\)/,'$2'))=>a<b?f(b):b

Try it online!

Repeat apply regex replace until no match found. The regex /\((.>)?(.)(<.)?\)/ get the calculate result as 2nd capturing group.


Save 1 byte, thanks to Arnauld

deleted 10 characters in body
Source Link
tsh
  • 35.6k
  • 2
  • 34
  • 129

JavaScript (Node.js), 6055 bytes

f=(a,b=a.replace(/\((.>)?(.)(<.)?\)/,c=>c[c[2]>'='?3:1]'$2'))=>a==b=>a<b?b:f(b):b

Try it online!Try it online!


Save 1 byte, thanks to Arnauld

JavaScript (Node.js), 60 bytes

f=(a,b=a.replace(/\(...\)/,c=>c[c[2]>'='?3:1]))=>a==b?b:f(b)

Try it online!

JavaScript (Node.js), 55 bytes

f=(a,b=a.replace(/\((.>)?(.)(<.)?\)/,'$2'))=>a<b?f(b):b

Try it online!


Save 1 byte, thanks to Arnauld

Source Link
tsh
  • 35.6k
  • 2
  • 34
  • 129
Loading