Hey, good work Jay! This is what I was doing, but your code is already refined better than mine.
The only thing I might question is using an array - you might a) hit the size limit and b) want the results in a permanent table for one reason or another. I almost always choose tables for these situations, for such reasons, plus I like having all the table commands available, generally they're more flexible. But that depends on needs, of course, and perhaps either one will do fine.
Otherwise, very good work, and it's up to Marvin if there needs to be a STOP IF SOLUTION FOUND, or whether he wants to gather all possible solutions.
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.