PLOTTO or Skyscrapers (QC-14)

The grid represents a plot with buildings of different heights. In each row and column, the heights 1~N occur exactly once each. The figures indicate the number of buildings visible in the corresponding row or column from a particular edge.