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.
I approached this problem counting surface from 4 directions: front, rear, left and right. Of course top and bottom are just H*W. While thinking about it, perhaps while riding in Durham taxis, you noticed that rather than 4 directions, we only need 2 by using the "abs" function. Brilliant observation mate! So well done!
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
3D Surface Area
You are viewing a single comment's thread. Return to all comments →
I approached this problem counting surface from 4 directions: front, rear, left and right. Of course top and bottom are just H*W. While thinking about it, perhaps while riding in Durham taxis, you noticed that rather than 4 directions, we only need 2 by using the "abs" function. Brilliant observation mate! So well done!