You are given an n × n grid representing a three dimensional shape composed of
Each value grid[i][j] represents the height of a tower of cubes placed at the grid cell (i, j).
A projection is the shadow cast by the shape onto a two dimensional plane. The shape is projected onto three planes:
The top view (the
The front view (the
The side view (the
Return the total combined area of all three projections.
Constraints:
n == grid.length == grid[i].length
n
grid[i][j]
You are given an n × n grid representing a three dimensional shape composed of
Each value grid[i][j] represents the height of a tower of cubes placed at the grid cell (i, j).
A projection is the shadow cast by the shape onto a two dimensional plane. The shape is projected onto three planes:
The top view (the
The front view (the
The side view (the
Return the total combined area of all three projections.
Constraints:
n == grid.length == grid[i].length
n
grid[i][j]