Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to calculate the Surface area of three-dimensional body in leetcode

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report