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.
I struggled with Time Limit Exceeded for n == 14 and 15 and tried to use memoization and other tricks to solve it with no luck.
Then I realized that all of the solutions on this page are building "one queen per column" (or one queen per row) into the placement function. This solves a lot of performance issues.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Super-Queens on a Chessboard
You are viewing a single comment's thread. Return to all comments →
I struggled with Time Limit Exceeded for n == 14 and 15 and tried to use memoization and other tricks to solve it with no luck.
Then I realized that all of the solutions on this page are building "one queen per column" (or one queen per row) into the placement function. This solves a lot of performance issues.