In mathematical terminology, we are asked to build a Latin square such that each row
and column is a permutation of length n with a given number of left-to-right and right-to-
left-maxima. The 7-by-7 skyscraper puzzle in Figure 1 is from the Eighth World Puzzle
Championship.