Queen’s Attack II

Do not recall if I received a message or decided to explore the Queen’s Attack II challenge from Hacker Rank. By the title there must have been a previous version. I decided not to look at it and just go for this one.

The challenge is well defined and there are no indications on which approach to use. I implemented it twice. On the first pass I went with what I considered a brute force approach with some refinements. Based on a sentence in the description of the challenge “A single cell may contain more than one obstacle; …” I figured that my first approach would fall short as far as timing out and it did. Something that I noted was that timeouts seem to be reported as errors when it should properly be labeled as a time out. Continue reading “Queen’s Attack II”