[Community Puzzle] abcdefghijklmnopqrstuvwxyz

Nice idea! Thank you for your puzzle!
But aren’t the there test cases with more than one solution? Does the validator accept them all or is there a “preferred” solution?
For example: Isn’t the following output a valid solution for “Test 1”, but different from the expected output mentioned in the puzzle description?

----------
abc-------
fedop-----
glmnqrsz--
hk--iuty-j
-----vwx--
----------
----------
----------
----------

The validator accepts only one solution per case.

The output stated in your post is not valid because one letter and the next letter must be adjacent.

Thanks again for the clarification. I thought it would be ANY number of tiles up, down, left, right for the next letter - as long as you stick to just one direction. Narrowing it down to just ONE tile up, down, left, right reduces it to just one solution. Got it!

Excellent code challenge, and it was fun to solve! I appreciate that you created this challenge, thank you!

I couldn’t pass validator 2 & 4. what could be the problem there?

It’s difficult to say as I can’t see any particular features of those validators.

Please double check your code first, and see if you can spot any issues. If not, you may PM me your code and I’ll take a look.

Very weak test cases, as often on codingame
Lot of exponential solutions passing through

If it’s assumed, then lower the constraints so that it is actually normal, and that these solutions can handle any valid testcase following these constraints

I am succeeding at the first 3 tests, but I failed at the 4 and 5, it says that my code is not optimise enought (which is true) but I wonder if it’s the only reason.
And if so, where did I go wrong with my approach ?
[Mod edit: Please avoid posting codes on the forum.]

For a start, you know where the "a"s are when you populate the variable sol (i.e.

sol[i,j]=c;

). If you store the positions at that time, you don’t have to look for them again by using another set of nested loops (i.e.

        for(int i=0;i<n;i++)
        {
            for(int j=0;j<n;j++)
            {
                if(sol[i,j].Equals('a'))

) later on.

Thank you, it’s better (even if it’s not enought to succeed in test 4 )
[Mod edit: Please avoid posting codes on the forum.]

Nice start. Now, let’s add this line of code after letter++:

Console.Error.WriteLine(letter + " " + k + " " + l);

Then run test case 4 again, and see what’s causing the timeout :wink:

Does anyone know why I cannot pass the first validator?

You can send your code in private, I’ll send back what’s wrong.

@JuProger , “in private” means you send a private message, instead of posting your code here and formatting it as a spoiler.

How can I make it in private? Are there any bb-codes? I need help.

To send a private message to nicola, you click on nicola’s icon, and then click “Message”:

Thank you for your reply. Is there somethig else for new users, because when I click it there is no message button?

Maybe it’s because you’re still a new user.

Can I post my code in public here?

I’ve just sent you a PM. Please see if you can receive it.