[Community Puzzle] Distributing Candy

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @BleedingWithin,validated by @nick552,@VictoriousTriceraton and @Leff.
If you have any issues, feel free to ping them.


Any hint on validator 2?

Nice puzzle @BleedingWithin

1 Like

You need to distribute k bags of candy and, among those k bags of candy, the bag with max amount should be as close as possible to the bag with minimum amount of candy. There is a simple way to do that :slight_smile:
I hope it helps.


I found simple way to distribute bags of candy :wink: I pass all tests in ide and all validators except validator #02.

I replaced my complex solution that I created at first with few lines of code so I guess I can improve it a little bit more.

I must admit that I have no idea for now how to solve it with 100% score. I will take a break and try tommorow =)

Still no luck with that validator number 2.

Maybe you could give me some hint whats so specific about that one?

There is nothing special with this validator, your algorithm is probably wrong.
Try different custom testcases, you can enable this feature with expert mode settings.

You were right. Thank you for telling me about that custom testcases.

1 Like

:wave: Hi to All :slight_smile:, and thanks to @BleedingWithin the Author (and @nick552,@VictoriousTriceraton and @Leff the validators) for this β€œCandy special gift” :wink: .
β†’ I have to say that brute force was my first approach … but i have to add that’s not the good method to pass all the Tests !
β†’ so, i suggest interested volunteers to think better (as mathematically additions :thinking:) and i try a best (and logic :hushed:) analysis approach …

Thanks to the Author :+1:, and good luck :handshake: to the others !
β†’ Never mind in mistakes : have :sun_with_face: sun, fun and CodinGames :keyboard: :stuck_out_tongue_winking_eye: : …

1 Like

Thank you @Jp82 <3

1 Like