I pass all test on easy puzzle Hunger Games (https://www.codingame.com/training/easy/hunger-games) but I don’t pass the last validator ( the 6th ) and I really don’t know why, I wrote again my solution twice, made some backwards and I’ve got the same result … anybody had the same problem and pass it ?
You was kinda right, I didn’t respect entirely the rule, I did the sorting when inserting killed person but forgot to do a sort each time I add new killed person. This way it passed the test 6 ( Alphabetize Victims ) where it’s indeed mandatory. So the tests are good, i’m just a dumbass
I figured it out. I am not very good at dictionaries, so i went for straight string manipulation. Found my problem, I lower cased key words, and these key words were apparently names. So be careful of that.
Hello,
For the Hunger Game puzzle by MSWS I have an error when submitting my code.
The 6th test does not pass, I know the submission tests are different from the ide tests however I am unable to find the reason to my error.
Is it possible to give me the 6th test so i can understand / correct my mistake please?
Thank you and sorry for the inconvenience.
I have a problem with the easy puzzle “Hunger games” in PHP :
I want to return an empty line, for make a return like this between each tributes : Name: Bowser Killed: None Killer: Mario
Name: Mario Killed: Bowser Killer: Winner
But with an “echo(“Killer: Mario\n”);echo(“\n”);”, I have this error : Find: Killer: WinnerEnd of line (\n) Waiting : Killer: WinnerNothing
If you have an idea of how to do?
Pretty clear for me. It’s says that the output ends with “end of line” while it should ends with “nothing”.
Have you tried to replace your echo(“\n”) with nothing (e.g. remove it )
Yes, I understand what you say, but the problem is this : I need to put one clear line between the two blocs of tributes.
But I can’t put a double “\n”, it make an error
Hi,
I have the same problem in JAVA.
If I put System.out.println(); or System.out.println(…“\n”) for the last line, I get the error message WinnerEnd of line (\n) instead of WinnerNothing.
And if I put no extra line, I get an error message too (found “Na…” instead of Nothing).
Did you find a solution (even in PHP, it might help me).
Thanx,
As I understand, the problem is that you are displaying new line to the very end of the list. It is expected that there is no empty line after last “Killer: …” line;
so we do like that:
if(i < tributes-1)
{
display empty line;
}
Did you understand?