https://www.codingame.com/training/medium/crossword
Send your feedback or ask for help here!
Created by @Humanosaure,validated by @IAmNoob,@CarlWalsh and @wlesavo.
If you have any issues, feel free to ping them.
https://www.codingame.com/training/medium/crossword
Send your feedback or ask for help here!
Created by @Humanosaure,validated by @IAmNoob,@CarlWalsh and @wlesavo.
If you have any issues, feel free to ping them.
Nice double problem. For me, print the solution was more complex than find them.
Hi Caduchon, do you have some hint for this? I canât think of a way to find the solutions.
I was thinking to start by finding all the intersections but then itâs not clear to me what to do with them in very complex cases. Thank you.
Search the letters that match.
Hi nicola, yes thank you, that is what I meant for âintersectionsâ, Iâve already got to that part. What is not clear to me is how you can determine the different solutions once you have all the letters that match.
Use brute-force.
There are only 4 ways to build a â#â by 2 horizontal and 2 vertical lines. Try out all of them to find the only way to make 4 common joints.
Yes, brute force.
My solution contains 4 for nested loops.
Iâd think about what it means to be a match, ie what is the criteria. Finding intersections are a good idea, thatâs what I did and using the different sets of intersections, I went from there.
Hey there
Thanks for the puzzle.
I sadly have a problem, hope you can help and maybe specify.
in test case 12 I get the result:
........C..
.AWAAAAAXAA
BBYBBBBBZB.
..D.....C..
..D.....C..
..D........
But I get the message:
Found:
âŚCâŚ
Expected:
0
should there be a condition that h1 comes before h2 and v1 left from v2?Preformatted text
The two horizontal words must be at least one row apart from each other.
If you donât follow this rule you create multiple 2 letter words in the crossword grid as well as adding the words you were meant to add.
@RoboStac thanks, that helps.
Thought 1 row apart meant ânot in the same rowâ but this makes a lot of sense!
This puzzle is great ! Handling the indexes drove me mad, but it was good
My solution nests 6 for loops. Maybe someone smart could rephrase it with 4 loops but it does not seem obvious.
Great puzzle. I tried a recursive approach but wasnât very successful, ended up nesting loops like everyone
One of my dirties solutions for sure.
For the output part I went nobrain, ended up putthing everything in a matrix with w, h = len(h1)+len(h2), len(v1)+len(v2) to make sure the dimensions are big enough,
and THEN killing empty rows and columns to adjust.
IMO this problem should belong to the Hard section.
Super cool puzzle! Well done @Humanosaure! For anybody looking to eliminate some of those nested for loops, see if your language has a pre-built cartesian product function. Pythonâs itertools.product helped me clean things up a bunch.