How to calculate the Surface area of three-dimensional body in leetcode
Editor to share with you how to find the surface area of a three-dimensional body in leetcode. I hope you will gain something after reading this article. Let's discuss it together.
Surface area of a three-dimensional body
On the grid of N * N, we put some 1 * 1 * 1 cubes.
Each value v = grid [I] [j] indicates that v cubes are superimposed on the corresponding cell (I, j).
Please return to the surface area of the final body.
Example 1: input: [[2]] output: 10 example 2: input: [1pyrrine 2], [3pyrrine 4]] output: 34 example 3: input: [1remi0], [0recover2]] output: 16 example4: input: [1pyrrine 1], [1magin1], [1pyrrine 1]] output: 32 example5: input: [2gime 2], [2Jing 2Jing 2], [2Jing 2Jo 2] output: 46
Hint: 10: ans-= 2 * min (grid [I] [j], grid [I] [j]) return ans has finished reading this article, I believe you have some understanding of "how to find the surface area of three-dimensional body in leetcode". If you want to know more about it, welcome to follow the industry information channel. Thank you for your reading!