problem
892. Surface Area of 3D Shapes
题意:感觉不清楚立方体是如何堆积的,所以也不清楚立方体之间是如何combine的。。
Essentially, compute the surface area of each grid but substract the overlapping areas.
All areas = surface + combined area so we have surface = 6 * total_count - 2 * combined_count
solution1:
solution2:
参考
1. Leetcode_easy_892. Surface Area of 3D Shapes;
2. grandyang;
3.discuss;
完