Chuck Norris puzzle discussion


chuck norrix


Y wonder the same >=/, damn headache


If you are using C++, bitset might help you.


The validator stops at the first character that isn’t as expected and only shows the output so far. It’s not a “final space”, there is additional output after the space.


OH my god! Thank you so much. Took me half a second to complete 100% after reading this! Thank you!


I am not certain the expected output for Test No. 3 (the %) is correct.
According to the output, it expects a 1011010 to be NorrisEncoded, but the binary representation of % is 0100101. If I put it this way, it will look different


Rest of the tests pass, so I assume, that the expected result for % test is buggy.


My code passes the 1st and 3rd tests, but 2 and 4 I get:
Process has timed out. This may mean that your solution is not optimized enough to handle some cases.

I didn’t think my code was that long, it just converts the ASCII text into their respective character code, then concatenates all of them into a binary string. I parse the binary string using a series of if-else statements to convert it to Chuck’s code. I’m guessing there’s a more efficient way to do this. Can somebody tell me what algorithm they used that worked?


Can anyone please take a look at my code? It passes the first three tests, but the fourth test doesn’t work.



There’s something weird with my code. First, i wrote it on codeblock (i’m working in C); works well. But when i copy it on CodinGame, it gave me 2 extra ‘0’ et the end -_-
I’ve managed to make it work, but i don’t understand: why? The code is the same! Where does thoses 00 comes from?

Still, the first step is done. For the second one, thought, i’m stuck with a segmentation fault. Since i’m not so good with sizes and segmentation, i’ll love to have you get a look at this, cause i really don’t see the problem:

    TUnaire[k+1]='\0';        //that was to kill the extra 0
    TailleTotale+=(k+1)*sizeof(char);  //TailleTotale=0 at the beginning of my code
    if(l==0){                             //it is the case 
        strncpy(Total, TUnaire, k); //SEGMENTATION FAULT! WHY?
    else{  //i don't enter this case for now, but i guess it'll have the same problem
         strcat(Total, TUnaire);
printf("%s\n", Total);

I really don’t get it. TUnaire is a char* which contain k+1 char, Total is an empty char* and i alloc it (k+1)*sizeof(char) space…Why the first one can’t copy in the second? I’ve even tried to copy only the first k characters of TUnaire, but that still don’t work.
Please help (


It’s hard to say without seeing the full code, but:

Does k have a sensible value? Moreover, if TUnaire can contain k+1 chars as you wrote it, TUnaire[k+1] is one past the end of TUnaire[] (and it’s an error).

Check the return value of malloc (Total != NULL).

Either Total or TUnaire are not valid pointers, or k is negative or too large, or there is bug elsewhere in your code.


why string.Length is not working in the IDE but is working in monodevelop IDE, I mean, I wrote the same code as did in monodevelop but in codingame IDE does not work, example :

  • monodevelop:

         while(index != binary.Length - 1 ){
      	n = binary.ElementAt (index);
      		Console.Write (binary.ElementAt (index));

it works, but it’s not in codingame IDE.


i have a probel with the last test and i don’t know what’s wrong -___-
chuck norris’s msg is sooo strong xDD


i have the same problem xD
i don’t know what’s wrong!! but when it came to “space” it give me a problem!
like 000 and expected 00 0


i corrected my problem xD
thx me :v


I got the same problem… How did you fix it?


Pls help! :’(

My program gives what the site wait in the C test: 0 0 00 0000 0 00

But the program says:
Expected: Nothing

Why??? I do not add a space to the end of the result string. What did i do wrong? Pls help! :’(


Maybe you are printing some extra char. Certify that you print only the answer and you can print a new line (\n) at end.


No, i’m not. I asked for help in the chat, but we couldn’t figure it out. I sent them my code, one guy told me, it’s working, but in an other guy computer my code made the same error.

I tried solve the first one this way: echo(“0 0 00 0000 0 00\n”);
But it writes the same error:

Found: " "
Expected: Nothing


This echo worked for me. If you want send me your code to test here.

echo("0 0 00 0000 0 00\n");

This code works for me.

Check you php code, it has be exactly this:

<?php echo("0 0 00 0000 0 00\n");

No new line before the <?php, and don,'t use the ?>. This way you’ll be sure there’s no extra characters in the ouput.