Skip to main content
deleted 31 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46

C (gcc), 117 \$\cdots\$ 111101 10198 bytes

Saved 10 bytes thanks to an idea from Davide!!!
Saved 3 bytes (and got below 100!) thanks to ceilingcat!!!

i;f(char*p){for(i=0;*p++-40||p[3]-41;++i);p[-1]=p[1]1]=p[p[1]-62?*p0:p[2];memcpy2];bcopy(p,p+4,p,strlen(p));i&&f(p-i-1p+~i);}

Try it online!Try it online!

C (gcc), 117 \$\cdots\$ 111 101 bytes

Saved 10 bytes thanks to an idea from Davide!!!

i;f(char*p){for(i=0;*p++-40||p[3]-41;++i);p[-1]=p[1]-62?*p:p[2];memcpy(p,p+4,strlen(p));i&&f(p-i-1);}

Try it online!

C (gcc), 117 \$\cdots\$ 101 98 bytes

Saved 10 bytes thanks to an idea from Davide!!!
Saved 3 bytes (and got below 100!) thanks to ceilingcat!!!

i;f(char*p){for(i=0;*p++-40||p[3]-41;++i);p[-1]=p[p[1]-62?0:2];bcopy(p+4,p,strlen(p));i&&f(p+~i);}

Try it online!

added 135 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46

C (gcc), 117 \$\cdots\$ 113111 111101 bytes

Saved 10 bytes thanks to an idea from Davide!!!

i;f(char*p){for(i=0;p[i++]i=0;*p++-40||p[i+3]40||p[3]-41;41;++i);p[i;p[-1]=p[i+1]1]=p[1]-62?p[i]*p:p[i+2];memcpyp[2];memcpy(p+ip,p+i+4p+4,strlen(p));~-i&&f;i&&f(p-i-1);}

Try it online!Try it online!

Explanation (before some golfs)

C (gcc), 117 113 111 bytes

i;f(char*p){for(i=0;p[i++]-40||p[i+3]-41;);p[i-1]=p[i+1]-62?p[i]:p[i+2];memcpy(p+i,p+i+4,strlen(p));~-i&&f(p);}

Try it online!

Explanation

C (gcc), 117 \$\cdots\$ 111 101 bytes

Saved 10 bytes thanks to an idea from Davide!!!

i;f(char*p){for(i=0;*p++-40||p[3]-41;++i);p[-1]=p[1]-62?*p:p[2];memcpy(p,p+4,strlen(p));i&&f(p-i-1);}

Try it online!

Explanation (before some golfs)

deleted 17 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46

Takes an input string with enclosing in parentheses and reduces the input stringit to either a left (<) or a right (>).

Takes an input string with enclosing in parentheses and reduces the input string to either a left (<) or a right (>).

Takes an input string with enclosing parentheses and reduces it to either a left (<) or a right (>).

added 31 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading
deleted 2 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading
added 11 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading
added 11 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading
added 15 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading
deleted 24 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading
added 2 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading
added 3 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading
added 3 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading
added 3 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading
added 17 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading
deleted 3 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading
deleted 3 characters in body
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading
Source Link
Noodle9
  • 20.3k
  • 3
  • 21
  • 46
Loading