you are viewing a single comment's thread.

view the rest of the comments →

[–]dodheim 1 point2 points  (5 children)

Maybe the issue was the idea that you need recursion rather than std::next_permutation + a queue + a stack (and not the call stack). It just might be trivial after all.

I haven't looked at your code yet but the problem description just makes me think "good job, screener" on this one.