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?
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!
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.]