• + 0 comments

    I first solved this problem with backtracking (which works great for games, or procedures with limited next steps available), but using the gcd was a lot simpler - I didn't think about it for a while, though. So there are a few ways to solve this problem!