Skyscrapers

Background

The various names of this puzzle reflect the idea that the grid represents a city block of buildings of various heights.

Puzzle and Goal

An unsolved puzzle consists of a square grid. There are numbers along the edges in some or all of the cells; the grid itself is blank.

The goal is to create a Latin square that satisfies the clues.

Rules

The solved grid must satisfy the following conditions:

Each clue represents the number of "buildings" that can be seen in that rank from that side; lower numbers are hidden by higher numbers. For instance, in a 4x4 puzzle, a 3 on the left edge could indicate any of these rows: 1342, 1324, 2341, 2314, 2134.

Variants

The rules at Janko.at suggest that some puzzles may have blank cells ("parks") in their solutions.