Skip to main content
Commonmark migration
Source Link

SOGL V0.12, 12 11 bytes

↔]»:l{Ƨ()øŗ

#SOGL V0.12, 12 11 bytes ↔]»:l{Ƨ()øŗ Try it Here!

Explanation:

↔            mirror characters
 ]           do ... while the top of stack is truthy
  »            put the last letter at the start
   :           duplicate it
    l{         length times do
      Ƨ()        push "()"
         ø       push ""
          ŗ      replace ["()" with ""]
             if the string left on stack is empty (aka all matched parentheses could be removed), then stop the while loop

Note: l{ could be replaced with ( for 10 bytes, but, sadly, it isn't implemented.

#SOGL V0.12, 12 11 bytes ↔]»:l{Ƨ()øŗ Try it Here!

Explanation:

↔            mirror characters
 ]           do ... while the top of stack is truthy
  »            put the last letter at the start
   :           duplicate it
    l{         length times do
      Ƨ()        push "()"
         ø       push ""
          ŗ      replace ["()" with ""]
             if the string left on stack is empty (aka all matched parentheses could be removed), then stop the while loop

Note: l{ could be replaced with ( for 10 bytes, but, sadly, it isn't implemented.

SOGL V0.12, 12 11 bytes

↔]»:l{Ƨ()øŗ

Try it Here!

Explanation:

↔            mirror characters
 ]           do ... while the top of stack is truthy
  »            put the last letter at the start
   :           duplicate it
    l{         length times do
      Ƨ()        push "()"
         ø       push ""
          ŗ      replace ["()" with ""]
             if the string left on stack is empty (aka all matched parentheses could be removed), then stop the while loop

Note: l{ could be replaced with ( for 10 bytes, but, sadly, it isn't implemented.

added 170 characters in body
Source Link
dzaima
  • 20.3k
  • 2
  • 42
  • 75

#SOGL V0.12, 12 11 bytes ↔]»:l{Ƨ()øŗ Try it Here!

Explanation:

↔            mirror characters
 ]           do ... while the top of stack is truthy
  »            put the last letter at the start
   :           duplicate it
    l{         length times do
      Ƨ()        push "()"
         ø       push ""
          ŗ      replace ["()" with ""]
             if the string left on stack is empty (aka all matched parentheses could be removed), then stop the while loop

Note: l{ could be replaced with ( for 10 bytes, but, sadly, it isn't implemented.

#SOGL V0.12, 12 11 bytes ↔]»:l{Ƨ()øŗ Try it Here!

Explanation:

↔            mirror characters
 ]           do ... while the top of stack is truthy
  »            put the last letter at the start
   :           duplicate it
    l{         length times do
      Ƨ()        push "()"
         ø       push ""
          ŗ      replace ["()" with ""]
             if the string left on stack is empty (aka all matched parentheses could be removed), then stop the while loop

#SOGL V0.12, 12 11 bytes ↔]»:l{Ƨ()øŗ Try it Here!

Explanation:

↔            mirror characters
 ]           do ... while the top of stack is truthy
  »            put the last letter at the start
   :           duplicate it
    l{         length times do
      Ƨ()        push "()"
         ø       push ""
          ŗ      replace ["()" with ""]
             if the string left on stack is empty (aka all matched parentheses could be removed), then stop the while loop

Note: l{ could be replaced with ( for 10 bytes, but, sadly, it isn't implemented.

added 488 characters in body
Source Link
dzaima
  • 20.3k
  • 2
  • 42
  • 75

#SOGL V0.12, 12 11 bytes ↔]»:l{Ƨ()øŗ Try it Here!

Explanation:

↔            mirror characters
 ]           do ... while the top of stack is truthy
  »            put the last letter at the start
   :           duplicate it
    l{         length times do
      Ƨ()        push "()"
         ø       push ""
          ŗ      replace ["()" with ""]
             if the string left on stack is empty (aka all matched parentheses could be removed), then stop the while loop

#SOGL V0.12, 12 11 bytes ↔]»:l{Ƨ()øŗ Try it Here!

#SOGL V0.12, 12 11 bytes ↔]»:l{Ƨ()øŗ Try it Here!

Explanation:

↔            mirror characters
 ]           do ... while the top of stack is truthy
  »            put the last letter at the start
   :           duplicate it
    l{         length times do
      Ƨ()        push "()"
         ø       push ""
          ŗ      replace ["()" with ""]
             if the string left on stack is empty (aka all matched parentheses could be removed), then stop the while loop
Source Link
dzaima
  • 20.3k
  • 2
  • 42
  • 75
Loading