Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 1
    \$\begingroup\$ Nice answer! :) You can save a few bytes: -1 byte by adding a variable for s.Length: int l; to int L,l; + s.Length%3>0 to (L=s.Length)%3>0 + s.Length<4? to L<4?. Then -4 bytes by changing "0"+s[0]+"0"+s[1]+"0"+s[2] to "0"+s[0]+0+s[1]+0+s[2]. And you don't have to count the trailing ; of the lambda, so it can move to the footer for another -1. Try it online - 229 bytes \$\endgroup\$ Commented Aug 8, 2022 at 14:41
  • 1
    \$\begingroup\$ It turns out I can actually just use l for s.length instead of a new variable L and save another 2 bytes. \$\endgroup\$ Commented Aug 11, 2022 at 9:07