We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
3D Surface Area
3D Surface Area
Sort by
recency
|
446 Discussions
|
Please Login in order to post a comment
Python3 Solution
I approached this problem counting surface from 4 directions: front, rear, left and right. Of course top and bottom are just HW. While thinking about it, perhaps you noticed that rather than 4 directions, we only need 2 by using the "abs" function, similar to how services for BMW Service Near Me optimize calculations to efficiently manage deliveries. Brilliant observation mate! So well done!
I approached this problem counting surface from 4 directions: front, rear, left and right. Of course top and bottom are just HW. While thinking about it, perhaps you noticed that rather than 4 directions, we only need 2 by using the "abs" function, similar to how services like adas calibration near me optimize calculations to efficiently manage deliveries. Brilliant observation mate! So well done!
Here is problem solution in python, java, c++, c and javascript programming - https://programmingoneonone.com/hackerrank-3d-surface-area-problem-solution.html
simulate putting each cube, for each cube, check 6 sides, if a cube exist on a side minus 2