![]() |
VOOZH | about |
Given length l, width b and height h of a cuboid. Return an array containing the total surface area and volume of the cuboid.
Examples:
Input: l = 1, b = 2, h = 3
Output: [22, 6]
Explanation: Surface Area = 2*(l*b + b*h + l*h) = 2*(2*3 + 3*1 + 1*2) = 22 and Volume = l*b*h = 1 * 2 * 3 = 6Input: l = 2, b = 3, h = 5
Output: [62, 30]
Explanation: Surface Area = 2(l*b + b*h + l*h) = 2 *(3*5 + 5*2 + 2*3) = 62 and Volume = l*b*h = 2 * 3 * 5 = 30
Cuboid has 6 rectangle-shaped faces. Each face meets another face at 90 degrees. Three sides of the cuboid meet at the same vertex. We can find Total Surface Area and Volume by using below formulas:
Total Surface Area = 2 * (l*w + w*h + l*h)
Volume= l*w*h
52 24