[Community Puzzle] Disordered First Contact

Hi all.

I need some help with “Disordered First Contact” puzzle (https://www.codingame.com/training/easy/disordered-first-contact). I have a problem with the last rule of encoding (see below):

Repeat by taking more and more characters then complete with what remains: ghi -> bcadef

What does this rule mean (I mean repeat what…)? Should I just take what left after first 6 chars and put in the front of the new string…?

Thanks.

1 Like

another player already complain about that. “Repeat” means repeat the steps you’ve taken: 2) and 3) if I remember well.

I’ll try to update the statement when I have the time.

We have the string to encode: “hello world”

After first iteration it becomes: “hel” + "lo " + “world”
After second: “elh” + "lo " + “world”
After third: "elhlo " + “world”

What is next? What should I “Repeat by taking more and more characters”. How should I eventually get “worlelhlo d”? It is completely unclear.

I’ve updated the description of the puzzle. Let me know if it helps.

Could you please continue my previous logic since third step?

Oh… wait. I think I see now )

UPD: It’s a way better now! Thanks

This puzzle is experiencing a low community success rate - and I suspect it’s due to test case #4 in C# … the boilerplate (and most other puzzles) rely on Console.ReadLine() to read in a line - but this can only read in 254 characters, which causes the input for test case #4 to be truncated, without any obvious feedback.

There is a way to read more, but I’m not sure that should be expected as part of the solution as it’s a platform issue, rather than a puzzle issue…

I checked in C# with the base code and there is no limitation to 254 characters … The input is not truncated in any case

Oh? Curious - was definitely an issue for me locally (also, docs also: https://docs.microsoft.com/en-us/dotnet/api/system.console.readline) - guess CG is running mono, perhaps? Nevermind!

It very much is.

There’s a typo in the example given. Line 3 reads:
3) Take “def” from defghi, add it at the end of bad -> bcadef

“bad” should read “bca”.

1 Like

i was able to encode the message, wasn’t a problem but decoding is kind of impossible. it is possible to use the code to make a turn and go back to normal, but the number of time is random.
Can you give me a hint plz

For each transformation, the number of steps to decode should be the same as the number of steps to encode. So you may try calculating the number of steps, and the number of characters involved in the last encoding step / first decoding step.

2 Likes