We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
It's just straight-forward backtracking (brute forcing).
Try to every board/word combination. Avoid bad word placements (bad overlap, not taking up an entire row/column, etc). Keep track of what you've placed so you don't place the same words twice.
You can code it mentally in a minute. It takes a while to type though.
How good are you at recursion? I recommend codingbat.com for very easy to medium recursion problems.
Crossword Puzzle
You are viewing a single comment's thread. Return to all comments →
It's just straight-forward backtracking (brute forcing).
Try to every board/word combination. Avoid bad word placements (bad overlap, not taking up an entire row/column, etc). Keep track of what you've placed so you don't place the same words twice.
You can code it mentally in a minute. It takes a while to type though.
How good are you at recursion? I recommend codingbat.com for very easy to medium recursion problems.
My Lengthy Java Solution https://www.hackerrank.com/challenges/crossword-puzzle/submissions/code/52906089
I haven't tried to make the code better, but I think it's neat enough to where you can read it.