N occurs exactly once in each row and in each column.
Your Challenge this month is to construct Latin Squares that are minimal, in the sense that each must form the smallest NxN digit base N number, where the digits are read off column by column, one row at a time. 4321 forms the smaller number 1234214334124321 . The winner will be the solution that correctly computes minimal Latin Squares in the least amount of execution time. This month's Challenge was suggested by Aaron Montgomery, who earns 2 Challenge points for making the suggestion This will be a native PowerPC Challenge, using the CodeWarrior Pro 5 environment. Solutions in Java will also be accepted, but Java entries must be accompanied by a test driver that uses the interface provided in the problem statement.