77
\$\begingroup\$

Challenge:

The concept is simple enough: write a full program to output its own code golf score!

Output should only be the byte count of your program and a trailing bytes.

BUT WAIT..... there is one restriction:

  • Your source code can not include any of the digits from your byte count
  • So if your score is 186 bytes, your program can not contain the characters 1 , 6 , or 8

Example Output:

315 bytes
27 Bytes
49 BYTES

Additional Rules:

  • Unnecessary characters, spaces, and newlines are forbidden in the source code, however trailing spaces and newlines are perfectly acceptable in output
  • There should be a single space between the number and bytes in the output
  • Letters are case insensitive
  • No self inspection or reading the source code
  • standard loopholes are disallowed

  • this is , so

Shortest code in bytes wins!

\$\endgroup\$
15
  • 7
    \$\begingroup\$ Does this need the quine tag, or may the code self-inspect? \$\endgroup\$
    – Adám
    Commented Mar 29, 2018 at 15:59
  • 3
    \$\begingroup\$ @Dat, given the formatting of the word bytes I suspect the intention is that the count should include the bytes it takes to print the text: bytes \$\endgroup\$ Commented Mar 29, 2018 at 16:16
  • 2
    \$\begingroup\$ Are leading spaces in output acceptable? \$\endgroup\$
    – rafa11111
    Commented Mar 29, 2018 at 17:43
  • 5
    \$\begingroup\$ If my code is 1 byte long, should I output 1 bytes or 1 byte? (keep in mind there are already 41 answers, although I don't think any are affected) \$\endgroup\$ Commented Mar 29, 2018 at 18:07
  • 2
    \$\begingroup\$ Can bytes be in any case pattern, e.g. bYtEs? \$\endgroup\$ Commented Dec 27, 2019 at 14:56

198 Answers 198

1
2 3 4 5
7
60
\$\begingroup\$

JavaScript, 19 bytes

Octal was invented to serve two purposes:

  • setting file permissions in Linux
  • answering this challenge

alert(023+' bytes')

Try it online!

\$\endgroup\$
4
  • \$\begingroup\$ Does this count as a full program? \$\endgroup\$
    – ericw31415
    Commented Mar 29, 2018 at 21:06
  • 1
    \$\begingroup\$ @ericw31415 This is a browser program, as defined in this meta answer. \$\endgroup\$
    – Arnauld
    Commented Mar 29, 2018 at 21:13
  • 22
    \$\begingroup\$ +1 because finally clarifying me why octal is not completely useless! \$\endgroup\$
    – sergiol
    Commented Apr 15, 2018 at 11:31
  • 1
    \$\begingroup\$ +1 for answering this challenge \$\endgroup\$ Commented Jun 25, 2020 at 1:31
39
\$\begingroup\$

Perl 5, 16 bytes

There are many other ways to get 16 but this one is mine

say afpbytes^PPP

Try it online!

\$\endgroup\$
2
  • 1
    \$\begingroup\$ How does this work? \$\endgroup\$ Commented Mar 30, 2018 at 13:00
  • 13
    \$\begingroup\$ @cairdcoinheringaahing In perl you can leave out the quotes on strings if they looks like a literal and don't conflict with a keyword (and is very much deprecated but we don't care in golf), Binary operators & | ^ and ~ can also be applied to strings and work on them like on a list of ASCII values (if and only if both sides are strings). For | and ^ it works as if the shorte string is extended with \0. After that is a simple exercise to find combinations of letters that xor to the desired output, \$\endgroup\$
    – Ton Hospel
    Commented Mar 30, 2018 at 14:12
38
\$\begingroup\$

7, 23 characters, 9 bytes

54340045141332401057403

Try it online!

This is a fairly hard challenge in a language that consists entirely of digits, but I managed it…

This is just 9 bytes in 7's encoding. (Strictly speaking, it's 8⅜ bytes (23 × ⅜ − ¼ because the final two trailing 1 bits can be omitted), but for the first time, PPCG's requirement to round up to a whole number of bytes is actually an advantage because it means that the extra trailing 1 bits are necessary and thus not banned by the question.) A reversible hex dump:

00000000: b1c0 2530 b6a0 22f8 1f                   ..%0.."..

The main challenge of writing this program in 7 was golfing it to under 10 bytes (as writing 7 without using 0 or 1 is pretty hard.) This uses the same structure as the standard "Hello world" program:

54340045141332401057403
5434004514133240105      commands 0-5 append literals to data space
                   7     start a new section of data space
                    403  another literal appended to data space
                         {implicit: eval the last section as commands}
                    4    swap 1st and 2nd sections with an empty section between
                     6   reconstruct the commands that would create the 1st section
                      3  output (+ some other effects we don't care about)

In other words, we start by creating two sections of the data space; we have two literals, each of which pushes a sequence of commands there. The second section (they're pushed stack-style so first push = last pop) is a fairly arbitrary sequence of commands but is pushed using the command sequence 5434004514133240105 (thus producing the data sequence 5434664574733246765; when discussing 7 in text, I normally use normal font for a command that pushes a literal, and bold for the corresponding resulting literal). The first section is pushed using the command sequence 403, producing 463. Then the first section is copied back to the program (an implicit behaviour of 7).

The 463 is now composed of (bold) commands that do something immediately, rather than (non-bold) commands that just push literals. 4 rearranges the sections to get our "string literal" into the first section. Then 0 does the operation that 7 is most known for: taking a section of data space, and reconstructing the command sequence that's most likely to have created it. In the case where the original command sequence was all 0-5, this is 100% accurate (unsurprisingly, as those commands purely push data and thus leave obvious evidence of what they did), and so we get our original sequence 5434004514133240105 back. Finally, 3 prints it.

So the remaining thing to look at here is the encoding of the string. This has its own domain-specific language:

5434004514133240105
5                    change encoding: 6 bits per character
 43                  select character set: digits and common symbols
   40                '9'
     04              space
       51            select character set: uppercase letters
         4133240105  'B' 'Y' 'T' 'E' 'S'

(There's no "select character set: lowercase letters" in the "digits and common symbols" character set – you have to go via a different character set first – so I needed to use uppercase to golf this short enough to fit underneath the effective 10-byte limit.)

\$\endgroup\$
22
\$\begingroup\$

Canvas, 8 bytes

8 bytes+

Try it here!

A more interesting 20 byte solution:

bytecount.innerText#

Try it here!

\$\endgroup\$
3
  • 5
    \$\begingroup\$ OK, that is pretty clever. \$\endgroup\$
    – Adám
    Commented Mar 29, 2018 at 15:58
  • \$\begingroup\$ Notice that one of the restrictions is "Your source code can not include any of the digits from your byte count" so the first solution is not valid in this case =) \$\endgroup\$ Commented Nov 4, 2019 at 6:23
  • 11
    \$\begingroup\$ @Cyclonecode That "8" there isn't a regular ASCII 8 though - it's a full-width 8 character in this unicode version of the code, though really it's the byte 0xD5, which is completely unrelated to any 8s \$\endgroup\$
    – dzaima
    Commented Nov 4, 2019 at 6:59
14
\$\begingroup\$

brainfuck, 53 BYTES

+[[<+>->->++>----<<<]>-]>-.--.<<<+.<.<.-----.>+++.<-.

Try it online!

Another submission with capitalised bytes. Found with the help of the excellent BF-crunch helper by primo.

\$\endgroup\$
12
\$\begingroup\$

PHP, 14 bytes

<?=7*2?> bytes
\$\endgroup\$
3
  • 9
    \$\begingroup\$ How about putting the bytes part outside the ?>? Try it online! \$\endgroup\$
    – Jo King
    Commented Mar 30, 2018 at 0:02
  • \$\begingroup\$ @JoKing great 3 less bytes :) \$\endgroup\$ Commented Mar 30, 2018 at 1:37
  • 1
    \$\begingroup\$ Just fyi, it's probably best that you split up your answer into multiple answers if you cover more than one language. \$\endgroup\$ Commented Mar 30, 2018 at 16:56
10
\$\begingroup\$

Stax, 5 bytes

╗↑╞ô╝

Run and debug it

Unpacked, it looks like this. Packed source mode makes this kind of trivial and uninteresting.

5p     print 5 with no line break
`5l@   print the compressed string " bytes"

If you don't want to use packed source mode, 6^p`5l@ works for 7 bytes.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ I've downvoted this answer, because I think that using packed mode, while a clever way of saving bytes, feels like cheating (which it isn't) at worst, and uncreative at best. Rather than go on a downvote spree of all Stax restricted-source answers, I'll leave this downvote to cover all such similar answers. \$\endgroup\$ Commented Apr 11, 2018 at 19:34
  • 1
    \$\begingroup\$ I certainly agree that it's uncreative. But I think the fault lies with the concept of restricted-source, not the language. This is actually the most direct way of producing "5 bytes" using Stax. \$\endgroup\$
    – recursive
    Commented Apr 11, 2018 at 19:36
10
\$\begingroup\$

Python 3, 25 24 18 bytes

print(6*3,'bytes')

Try it online!

\$\endgroup\$
3
  • 1
    \$\begingroup\$ But "4" is in "24". Maybe "33-9"? \$\endgroup\$
    – recursive
    Commented Mar 29, 2018 at 15:44
  • \$\begingroup\$ @recursive 3*8 should be fine, though \$\endgroup\$ Commented Mar 29, 2018 at 15:45
  • \$\begingroup\$ @recursive whoops, fixed it :P \$\endgroup\$
    – Maya
    Commented Mar 29, 2018 at 15:47
9
\$\begingroup\$

PHP older than 7.2, 13 bytes

Assumes default settings (E_NOTICE warnings disabled) and PHP version older than 7.2.

Needs to be decoded with xxd -r

00000000: 3c3f 3d7e cecc df9d 868b 9a8c 3b         <?=~........;

Or if you prefer Base64

PD89fs7M352Gi5qMOw==

Try it online!

\$\endgroup\$
0
8
\$\begingroup\$

Keg, 6 bytes

bytes

Uses an unprintable character at the beginning to push 6 to the stack. Then when it gets printed at the end, a space is automatically added after the 6 due to it being an integer.

Try it Online!

\$\endgroup\$
8
\$\begingroup\$

Pyramid Scheme, 477 440 BytEs

     ^   ^       ^   ^       ^   ^
    ^-  / \     ^-  / \     ^-  / \
   / \ /out\   / \ /out\   / \ /out\
  /out\-----^ /out\-----^ /out\-----^
 ^-----^   / \-----^   / \-----^   / \
 -^   / \ /chr\   / \ /chr\   / \ /chr\
  -^ /chr\-----^ /chr\-----^ /chr\-----^
  /*\-----^   / \-----^   / \-----^   / \
 ^---^   / \ /66 \   / \ /116\   / \ /115\
/8\ / \ /32 \-----  /121\-----  /69 \-----
---/55 \-----       -----       -----
   -----

Try it online!

Outputs 440 BytEs by multiplying 8 by 55.

\$\endgroup\$
6
  • \$\begingroup\$ Wouldn't that violate the rule against unnecessary whitespace? Or maybe I don't understand? \$\endgroup\$ Commented Jun 24, 2020 at 1:54
  • \$\begingroup\$ @SteveBennett You're right. I've modified it so that the program doesn't have redundant characters (though it can be golfed pretty easily \$\endgroup\$
    – Jo King
    Commented Jun 25, 2020 at 12:30
  • 2
    \$\begingroup\$ 431 bytes, Psll code: (out (_ 431) " ") (out _ "b") (out _ "y") (out _ "t") (out _ "e") (out _ "s") \$\endgroup\$ Commented Aug 28, 2020 at 23:39
  • 1
    \$\begingroup\$ @MarcinKonowalczyk There's a source restriction on this challenge so that you can't use numbers from the score (in your case 4,3 or 1) \$\endgroup\$
    – Jo King
    Commented Aug 29, 2020 at 2:58
  • \$\begingroup\$ though i managed to modify the format to work \$\endgroup\$
    – Jo King
    Commented Aug 29, 2020 at 3:32
7
\$\begingroup\$

R, 16 bytes

cat(4*4,"bytes")

Try it online!

\$\endgroup\$
9
  • \$\begingroup\$ Isn't it 17 because of your missing space? \$\endgroup\$
    – PmanAce
    Commented Mar 30, 2018 at 3:05
  • \$\begingroup\$ @PmanAce "Output should only be the byte count of your program and a trailing bytes". The program is 16 bytes. \$\endgroup\$
    – Giuseppe
    Commented Mar 30, 2018 at 3:13
  • \$\begingroup\$ cat by default adds a space between its inputs. \$\endgroup\$
    – Giuseppe
    Commented Mar 30, 2018 at 3:13
  • \$\begingroup\$ object.size outputs in the correct format (with bytes included by default). Annoyingly, the shortest I could find is 17: object.size(0)-39. TIO \$\endgroup\$ Commented Aug 2, 2019 at 16:12
  • 1
    \$\begingroup\$ Apparently, in Hadley's version, a 1-length vector is of length 48, so there must exist a version of R in which this 16-byte code works: object.size(0)/3. \$\endgroup\$ Commented Aug 3, 2019 at 8:13
7
\$\begingroup\$

Bash, 21 bytes

"Read your own source code" is clearly not the winner here, but no one else submitted one, so what the heck.

echo `wc -c<$0` bytes

Try it online!

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

dc, 14 11 bytes

[ bytes]Bnn

Try it online!

-3 bytes by @Cows quack

\$\endgroup\$
4
  • \$\begingroup\$ [ bytes]Bnn shaves some bytes \$\endgroup\$
    – user41805
    Commented Mar 29, 2018 at 15:52
  • \$\begingroup\$ @Cowsquack thanks! \$\endgroup\$
    – Maya
    Commented Mar 29, 2018 at 15:55
  • \$\begingroup\$ @cowsquack duckies go MOO, I'd assume :P? \$\endgroup\$ Commented Mar 30, 2018 at 22:05
  • \$\begingroup\$ @MagicOctopusUrn Ducks, what are ducks? :P \$\endgroup\$
    – user41805
    Commented Mar 31, 2018 at 9:03
6
\$\begingroup\$

05AB1E, 6 bytes

₂¤“ÿ¡Ï

Try it online!


₂      # [26]        | Pushes 26 (many other alternatives).
 ¤     # [2, 6]      | Split out tail.
  “ÿ¡Ï # ['6 bytes'] | ÿ = "Interpolate top of stack.", ¡Ï = "bytes" (compressed)

Alternatives for ₂¤ include: 5>, ₁¤,

\$\endgroup\$
1
  • 7
    \$\begingroup\$ Too bad this doesn't work. \$\endgroup\$ Commented Mar 29, 2018 at 16:19
6
\$\begingroup\$

PHP + HTML, 16 bytes

&#49;&#54; bytes

Yes, this is getting pretty close to loophole abuse, but I felt this needed to be posted. And the use of PHP means that this answer technically is written in a Turing-complete programming language. Of course, any other similar HTML templating language would work just as well.

Live demo (without PHP):

&#49;&#54; bytes

\$\endgroup\$
2
  • \$\begingroup\$ Beat me to it! And the ; can usually be omitted! \$\endgroup\$
    – wedstrom
    Commented Apr 2, 2018 at 21:53
  • \$\begingroup\$ Ahh but then it would be 14/15 bytes \$\endgroup\$
    – wedstrom
    Commented Apr 2, 2018 at 21:57
6
\$\begingroup\$

Whitespace, 112 bytes

Just because nobody's done it yet:

   			    
	
 	   
   	 	  		
   	   	 	
   	 	 	  
   	 		  	
   	    	 
   	     

  
	
   
 
	  

 


   




Try it online!

Prints " BYTES" in caps, since uppercase letters have shorter binary ASCII codes. The commands in the program, in my own made up visible notation, are:

Push 112
PrintNum
Push 0
Push 0x53
Push 0x45
Push 0x54
Push 0x59
Push 0x42
Push 0x20
Label _
PrintChr
Dup
JumpZ S
Jump _
Label S
End
\$\endgroup\$
2
6
\$\begingroup\$

Brain-Flak, 100 BYTES 80 bYTES

((((((()()()))[]{})))((({}){})(((({}){}))<([]([](([][][])([{}]()({{}}))))[])>)))

Try it online!

Outputs the bytes part in reverse title case. Does away with the (<>) abuse to pad the stack height and instead reuses those elements to add up to 83 for the final push, as well as contributing to pushing the 80 part.

Initially, this pushes 3 8 8 32 32 to the main stack while pushing 8 16 32 to the "third" stack (this is used to produce 80 (8+16+32,16+32,32)). Then inside that we push the bytes part inside a < >. Here we use the stack height (5) to get the differences between the elements (9 5 15 -14) before finally summing the stack to produce 83 (S).

\$\endgroup\$
2
5
\$\begingroup\$

Octave, 22 bytes

disp([50 50 ' bytes'])

Try it online!

\$\endgroup\$
5
\$\begingroup\$

Retina, 15 bytes


 bytes
*>w`..+

This program counts the number of substrings with at least two characters in the string " bytes", and then prints this count and the string itself.

Try it online!

\$\endgroup\$
5
\$\begingroup\$

Haskell, 26 bytes

main=putStr$"\50\54 bytes"

Try it online!


29 bytes

main=putStr$pred<$>"3:!czuft"

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ Unnecessary whitespace is now forbidden, but you can use a $ instead. \$\endgroup\$ Commented Mar 30, 2018 at 0:57
  • \$\begingroup\$ @ØrjanJohansen Thanks for pointing out. \$\endgroup\$
    – Laikoni
    Commented Mar 30, 2018 at 10:42
5
\$\begingroup\$

Applescript, 15 bytes

Yes, I’m going there.

9+6&”bytes”
\$\endgroup\$
6
  • 1
    \$\begingroup\$ But... Your source code can not include any of the digits from your byte count \$\endgroup\$
    – nicael
    Commented Mar 29, 2018 at 19:10
  • \$\begingroup\$ @nicael Dang, you’re right. One second then... \$\endgroup\$
    – DonielF
    Commented Mar 29, 2018 at 19:12
  • \$\begingroup\$ Correct me if I'm wrong, but isn't a multibyte character (3 bytes in Unicode if I remember correctly), so this is more than 11 bytes? \$\endgroup\$ Commented Apr 3, 2018 at 0:35
  • \$\begingroup\$ @cairdcoinheringaahing ...Shoot. You’re right - “ is 2 bytes, upping this to 15. \$\endgroup\$
    – DonielF
    Commented Apr 3, 2018 at 1:05
  • \$\begingroup\$ does this not still print 11? \$\endgroup\$ Commented Apr 3, 2018 at 3:11
5
\$\begingroup\$

Poetic, 277 bytes

for the A.I. system i did, i tried to put in humans
i know i am one of those
i am trying human testing for cyber-enabled virtual brains
a for-profit company rakes in massive loads of cash educating interns,
& then force-feeding things to all the interns until we earn a diploma

Outputs 277 bytes.

Try it online!

Poetic is an esolang I made in 2018 for a class project. It's basically brainfuck with word-lengths instead of symbols.

This was a fun program to write, although I'm not entirely sure I've fulfilled the "no unnecessary characters" requirement. If my answer needs to be amended, let me know!

\$\endgroup\$
1
  • 1
    \$\begingroup\$ "& then force-feeding things to all the interns until we earn a diploma". Absolutely wonderful! \$\endgroup\$
    – lyxal
    Commented Nov 3, 2019 at 10:47
4
\$\begingroup\$

MATL, 13 bytes

'57$f}xiw'4-c

Try it online!

This pushes the string '57$f}xiw' and subtracts 4, to get 13 bytes. This is converted to characters using c.

\$\endgroup\$
2
  • \$\begingroup\$ 6EV' bytes'h is 12 (I was just about to post it) \$\endgroup\$
    – Giuseppe
    Commented Mar 29, 2018 at 16:11
  • 1
    \$\begingroup\$ although it's the same boring approach :P \$\endgroup\$
    – Giuseppe
    Commented Mar 29, 2018 at 16:11
4
\$\begingroup\$

Octave, 23 bytes

printf('%i bytes',9+14)

Try it online!

And this:

disp(['','67$f}xiw'-4])

Try it online!

\$\endgroup\$
3
  • \$\begingroup\$ The first answers seems fine, but... how does the second one works? o.O \$\endgroup\$
    – rafa11111
    Commented Mar 29, 2018 at 18:14
  • 2
    \$\begingroup\$ @rafa11111 Subtracting 4 from (the ASCII codes of) '67$f}xiw' gives the ASCII codes of '23 bytes'. Then, concatenating with the empty string '' converts ASCII codes to chars \$\endgroup\$
    – Luis Mendo
    Commented Mar 29, 2018 at 19:07
  • 2
    \$\begingroup\$ @Luis Mendo Pretty clever! Thanks for clarifying! \$\endgroup\$
    – rafa11111
    Commented Mar 29, 2018 at 19:13
4
\$\begingroup\$

Petit Computer BASIC, 11 bytes

?9+2,"bytes

Using a comma in a print statement will move the cursor over to the next multiple of the current tab size. In SmileBASIC, that is 4 by default, so this would output 11 bytes (2 spaces) but PTC BASIC used 3 instead, so the output has the correct spacing.

\$\endgroup\$
4
\$\begingroup\$

APL (Dyalog Unicode), 12 bytes

Full program which implicitly prints to STDOUT.

'bytes',⍨3×4

Try it online!

,⍨ is appends the string to the result of the multiplication. APL's default display of mixed-type data puts a space between a number and subsequent text.

\$\endgroup\$
2
  • \$\begingroup\$ I may be wrong, but don't you have a 2 in your byte count and program? 3*4 should be fine though \$\endgroup\$ Commented Mar 29, 2018 at 20:04
  • \$\begingroup\$ @fyrepenguin Heh, right you are, of course. How silly of me. \$\endgroup\$
    – Adám
    Commented Mar 29, 2018 at 20:39
4
\$\begingroup\$

C, 33 32 bytes

main(){printf("%d bytes",040);}

There is a trailing newline, which is not "unnecessary" since the C standard demands it. Try it online here.

Thanks to NieDzejkob for golfing 1 byte.

Alternative with the same bytecount, thanks to ErikF:

main(){printf("%d bytes",' ');}

Try it online here.

\$\endgroup\$
6
  • \$\begingroup\$ , 040 for 32 bytes \$\endgroup\$
    – Maya
    Commented Mar 29, 2018 at 15:58
  • \$\begingroup\$ , 040 is against the (updated) rules but I added a trailing newline instead of the space. Thank you! \$\endgroup\$ Commented Mar 29, 2018 at 16:25
  • 2
    \$\begingroup\$ You could also use ,' ' to avoid any numerals at all! \$\endgroup\$
    – ErikF
    Commented Mar 30, 2018 at 5:51
  • \$\begingroup\$ @ErikF now that is clever. thanks :) \$\endgroup\$ Commented Mar 30, 2018 at 11:15
  • \$\begingroup\$ 31 bytes \$\endgroup\$
    – Steadybox
    Commented Mar 30, 2018 at 11:53
4
\$\begingroup\$

Java 5 or 6, 44 bytes (full program)

enum A{A;{System.out.print(0x2C+" bytes");}}

No TIO-link, because Java 5/6 is old.. In Java 5/6 it was possible to have an enum with code instead of the mandatory main-method, making it shorter for full program challenges.

Also errors with java.lang.NoSuchMethodError: main\nException in thread "main" in STDERR after printing to STDOUT, which is fine according to the meta (but if the challenge would have disallowed additional errors to STDERR, System.exit(0); can be added (and the octal numbers has to be updated) to prevent the error.

Suggested by @OlivierGrégoire (and his relevant Java tip).

Java 8+, 74 bytes (full program)

interface M{static void main(String[]a){System.out.print(0112+" bytes");}}

Try it online.

Java 8+, 16 15 bytes (lambda function)

v->0xF+" bytes"

-1 byte thanks to @OliverGégoire.

Try it online.

\$\endgroup\$
14
  • 2
    \$\begingroup\$ Technically not a full program :) \$\endgroup\$ Commented Mar 29, 2018 at 15:54
  • \$\begingroup\$ @O.O.Balance Oops.. somehow read past that, thanks for the correction. There goes my score.. XD \$\endgroup\$ Commented Mar 29, 2018 at 16:48
  • 1
    \$\begingroup\$ 37*2 contains a 7, so it is not valid. Your alternative solution is fine though. \$\endgroup\$ Commented Mar 29, 2018 at 23:01
  • 1
    \$\begingroup\$ v->0xE+"bytes" or v->0xF+" bytes". Can't test but should work anyways. Nothing says the score and "bytes" must be separated. \$\endgroup\$ Commented Mar 30, 2018 at 10:56
  • 1
    \$\begingroup\$ @OlivierGrégoire I know, I know. ;) When I posted the full program I was doubting to answer it as enum thinking about your tip-answer. Do you know any online compiler that still supports it? I prefer to have a link with test code for my answers.. \$\endgroup\$ Commented Mar 30, 2018 at 14:36
4
\$\begingroup\$

FerNANDo, 79 bytes

3 3
1
2 2
0 1 3 3 1 2 2 3
0 1 3 3 2 1 0 2
0 1 3 0 0 1 0 1
0 3 3 1 0 0 3 1
1 1
1

Try it online!

\$\endgroup\$
1
2 3 4 5
7

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.