Skip to main content
added 344 characters in body
Source Link
Unrelated String
  • 23k
  • 3
  • 32
  • 55

Jelly, 88 6 bytes

s2EÐḟṪṪoEÐḟṪṪo

Try it online!Try it online!

-2 bytes thanks to Nick Kennedy informing me of a rules change. (His proposed golf, EÐḟFȯṪ, seems somewhat more clever but has the same length as my previous solution minus s2.) The input format now takes the commands as a list of two-character strings, but the testing footer translates from the old format for convenience.

Translated from my newer Brachylog solution.

Old version:

Jelly, 13 bytes

ḢẎ⁼⁹a⁸o
s2ç@ƒ

Try it online!

I'm not 100% sure this is correct, but it succeeds on all three test cases. Takes the commands as the left argument and the initial accumulator as the right argument.

Jelly, 8 bytes

s2EÐḟṪṪo

Try it online!

Translated from my newer Brachylog solution.

Old version:

Jelly, 13 bytes

ḢẎ⁼⁹a⁸o
s2ç@ƒ

Try it online!

I'm not 100% sure this is correct, but it succeeds on all three test cases. Takes the commands as the left argument and the initial accumulator as the right argument.

Jelly, 8 6 bytes

EÐḟṪṪo

Try it online!

-2 bytes thanks to Nick Kennedy informing me of a rules change. (His proposed golf, EÐḟFȯṪ, seems somewhat more clever but has the same length as my previous solution minus s2.) The input format now takes the commands as a list of two-character strings, but the testing footer translates from the old format for convenience.

Translated from my newer Brachylog solution.

Old version:

Jelly, 13 bytes

ḢẎ⁼⁹a⁸o
s2ç@ƒ

Try it online!

I'm not 100% sure this is correct, but it succeeds on all three test cases. Takes the commands as the left argument and the initial accumulator as the right argument.

added 342 characters in body
Source Link
Unrelated String
  • 23k
  • 3
  • 32
  • 55

Jelly, 8 bytes

s2EÐḟṪṪo

Try it online!

Translated from my newer Brachylog solution.

Old version:

Jelly, 13 bytes

ḢẎ⁼⁹a⁸o
s2ç@ƒ

Try it online!

I'm not 100% sure this is correct, but it succeeds on all three test cases. Takes the commands as the left argument and the initial accumulator as the right argument.

Jelly, 13 bytes

ḢẎ⁼⁹a⁸o
s2ç@ƒ

Try it online!

I'm not 100% sure this is correct, but it succeeds on all three test cases. Takes the commands as the left argument and the initial accumulator as the right argument.

Jelly, 8 bytes

s2EÐḟṪṪo

Try it online!

Translated from my newer Brachylog solution.

Old version:

Jelly, 13 bytes

ḢẎ⁼⁹a⁸o
s2ç@ƒ

Try it online!

I'm not 100% sure this is correct, but it succeeds on all three test cases. Takes the commands as the left argument and the initial accumulator as the right argument.

Source Link
Unrelated String
  • 23k
  • 3
  • 32
  • 55

Jelly, 13 bytes

ḢẎ⁼⁹a⁸o
s2ç@ƒ

Try it online!

I'm not 100% sure this is correct, but it succeeds on all three test cases. Takes the commands as the left argument and the initial accumulator as the right argument.