https://www.codingame.com/training/easy/are-the-clumps-normal

Send your feedback or ask for help here!

Created by @MattZ,validated by @JBM,@b0n5a1 and @Niako.

If you have any issues, feel free to ping them.

https://www.codingame.com/training/easy/are-the-clumps-normal

Send your feedback or ask for help here!

Created by @MattZ,validated by @JBM,@b0n5a1 and @Niako.

If you have any issues, feel free to ping them.

1 Like

Only issue I had with this puzzle was that the default code parsed the input into a long, not compatible with the bigger test cases.

Had fun nonetheless

still cannot figure out what the problem meansâ€¦ can somebody do more explain about this?

N = 157285

B = 2

it said â€śsplit up the digits of N into a minimum number of clumps such that all of the digits D in each clump are modularly congruent in base Bâ€ť, then the example split N into this:

clumps = [157, 28, 5]

D % B = [1, 0, 1]

but how? why 157285 should be splitted into these clumps , but not like this:

clumps = [1, 572, 85]?

D % B = [1, 0, 1]

Thereâ€™s a lot of mathematical vocabulary for a relatively simple thingâ€¦

Itâ€™s all about the result of the modulo:

- 1%2=5%2=7%2=1, first clump.
- 2%2=8%2=0, second clump.
- 5%2=1, last clump.

Thatâ€™s allâ€¦

Edit: Erf typed too fast, corrected. Thx @Djoums

10 Likes

Your first line should be =1 and the second =0, otherwise itâ€™s even more confusing

1 Like

thatâ€™s clear and simple example for me , and finally I totally understand what it means, thanks!!

I passed all the validators, but not two of the test cases, 5 and 7.

Never happened to me before, canâ€™t figure out why.

It would be helpful if youâ€™ll add @anon72424297 explanation in the statement example

next to

Thanks @anon72424297, I didnâ€™t understand it without your explanation

2 Likes

Once I understood this, it was a good programming challenge, but I found the description to not be clear enough for me to understand. I had to look at the discussion section for more explanation.