http://www.perlmonks.org?node_id=180468


in reply to Re: Puzzle: need a more general algorithm
in thread Puzzle: need a more general algorithm

By the way, $columns = 2 gives:

best result: 0 3 4 1 5 2

$columns = 4 gives:

best result: 0 1 2 3 4 5