Your challenge is to construct a building which will be made of a pile of n cubes. The cube at the bottom will have a volume of n^3, the cube above will have volume of (n-1)^3 and so on until the top with a volume of 1^3.
You are given the total volume m of the building. Being given m can you find the number n of cubes you will have to build?
The parameter of the function f will be an integer m and you have to return the integer n (such as n^3 + (n-1)^3 + ... + 1^3 = m) or 0 if there is no such n.
Want to propose a challenge idea for a future post? Email firstname.lastname@example.org with your suggestions!