Problem Description: Write a function that returns the total surface area and volume of a box as an array:
[area, volume].
Level: 8kyu
Link to Kata: Area and Volume
Doing a simple Kata as I am a bit short on time. This is a 8kyu Kata so it is a very simple Kata. We are given width,height and depth of a box and we have to find the total surface area and volume of the box. We declare an "ans" array. After we are able to find the total surface area and volume of a box by using formula for a cuboid we push both the values to the "ans" array and output our array.
Here is a link to the code: Kata Day 19
Please mention your suggestions or your doubts in the comment below.
Happy coding. :)
No comments:
Post a Comment