Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @java_coffee_cup,validated by @Rafarafa,@Eulero314 and @Stef_3.
If you have any issues, feel free to ping them.
Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @java_coffee_cup,validated by @Rafarafa,@Eulero314 and @Stef_3.
If you have any issues, feel free to ping them.
Hey, Iâm having trouble understanding one of the examples I failed on:
Hereâs the group printed as it was received:
-9 -2 2 -6 -5 5 6 9
I responded â2â but it turns out I should have selected -1. Can someone help me understand why this is an invalid answer? @java_coffee_cup
If it helps, this is under âBasic validatorâ. My code passes all other test cases. (Well, except the two after this one, as itâs the 98th test case and I canât check those)
Nevermind! I messed up in my debug checking, itâs the NEXT one that failed and itâs obvious. Cheers on a great puzzle!
Yes it was the next line that caused failure. Good to know you found it out by yourself.
Okay, I gotta ask, howâd you know???
Seems like a really rare edge case that triggered due to an oversight I made on examining the outer doll.
I guessed CG was printing out the last line it can print before an error was found. If that line did not trigger an error, the next line could be.
The last 3 lines of the example have
Input
-11 11
-5 -4 -3 -2 -1 1 2 3 4 5
-10 -3 -2 2 3 -1 1 -5 -4 -1 1 4 5 10
Output
1
1
3
shouldnât the output for them be this ??
0
1
2
The first one is a stand alone solid doll. Ans is 1.
The third one has been drawn in the statement with lines connecting pairs of doll parts. The solid dolls sizes are #2, #1 and #1. No more smaller dolls are insides these three pairs of parts.
-10 -3 -2 2 3 -1 1 -5 -4 -1 1 4 5 10
so every doll with nothing inside is solid - that wasnât clear to me from the description - I thought only 1-size-dolls are solid.
but the description is clear enough - i see it now
âThe size #3 doll has a size #2 solid doll inside.â
well, thanks for your time . . .
The definition of âsolidâ can be found in a line below the first example:
â⌠without another doll inside indicating this doll is a solid woodâ