Skyscrapers Sudoku

Skyscraper Sudoku is a logic puzzle. In this Sudoku variant, the number of visible numbers is given for each row and column.

Skyscrapers Sudoku

Rules: Write numbers from 1 to N into the cells of the grid of size NxN. Each number must appear exactly once in each row, column, and block.
Additional rules: A number at the edge of the grid indicates how many numbers are higher than all previous numbers if you “look into” the grid at the given position.