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.
A great exercise since it's so open-ended as to how you really want to solve it. Excellent practice for OOP, since constructing helper functions and ultimately classes will make it all a lot easier than manipulating strings directly.
Overall, thought it was going to be harder: I pre-emptively built out an "update" loop in my class that I thought I was going to have to flesh out with various sudoku strategies, with recursive backtracking always running after other optimizations. But my first attempt culling candidates by obvious singles was enough to optimize it to pass; I didn't need to employ "hidden" singles or any other higher-level Sudoku strategies. If I wanted to race against others, maybe!
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #96: Su Doku
You are viewing a single comment's thread. Return to all comments →
A great exercise since it's so open-ended as to how you really want to solve it. Excellent practice for OOP, since constructing helper functions and ultimately classes will make it all a lot easier than manipulating strings directly.
Overall, thought it was going to be harder: I pre-emptively built out an "update" loop in my class that I thought I was going to have to flesh out with various sudoku strategies, with recursive backtracking always running after other optimizations. But my first attempt culling candidates by obvious singles was enough to optimize it to pass; I didn't need to employ "hidden" singles or any other higher-level Sudoku strategies. If I wanted to race against others, maybe!