3
\$\begingroup\$

In the challenges, does it count in bytes or character length. Because one character can 1 byte ranging from charcode 0 to 255, 2 bytes ranging from 0 to 65535, etc.

\$\endgroup\$
6
\$\begingroup\$

If you click on the tag, then click "learn more" from that page, you will see the tag wiki which gives useful information about code golf. At the bottom of the page under the heading "Things to note" there is this:

  • Unless the question is specified to be scored by characters, it is scored by bytes. If it doesn't specify a character encoding to use for scoring, answers which use Unicode code points outside 0 to 255 should state the encoding used.

The same works for finding out more about any other tag too.


As Draco18s points out in a comment, it's also worth noting that TIO scores languages with custom code pages according to that language's custom code page (even if the symbols themselves are from deep within Unicode). So any answer using a TIO link can be correctly scored.

\$\endgroup\$
  • 1
    \$\begingroup\$ Its also worth noting that TIO scores languages with custom code pages according to that language's custom code page (even if the symbols themselves are from deep within Unicode). So any answer using a TIO link can be correctly scored. \$\endgroup\$ – Draco18s Jun 24 at 16:35
  • 5
    \$\begingroup\$ For languages with SBCS, TIO just assumes that each character is a single byte rather than try and figure out if they're in the code page, so it's not necessarily correct in all cases \$\endgroup\$ – Jo King Jun 26 at 3:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .