Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
same issue in JS
tests are not broken in C++ (your language)
your code does not adhere to one of the directives:
Ah yes, that was my mistake. Fixed it and it works now, thanks.
Your code does not check for invalid sides correctly.
What does your solution return for
volume = -8, side = -2
? (Hint: it is notfalse
).For some reason my kata passes all basic tests (typescript), but fails random test. Confused with what is wrong, as I followed the description and everything otherwise works.
Approved
python new test framework is required. updated in this fork
Approved
Approved
Scala translation
CoffeeScript translation
That's because the way you check for negative side and volume is not exactly correct. Your solution returns a wrong answer for
volume=-8, side=-2
.This comment is hidden because it contains spoiler information about the solution
I passed this kata but then realised that I had misunderstood the question. I thought it was asking whether the REMAINING two sides would be equal - in other words a cuboid with volume 80 and side 5 would mean that the two remaining sides are equal because 80/5 = 16 and 16 is a square number - so the remaining two sides would both be the square root of 16 : 4. Using this example, a 5 x 4 x 4 cuboid would pass as true in my code even though clearly it is not. Extra testing needed I think?
I don't think it's not possible to solve it.
First I thought to make a cubic root on the volume and, if it is the same as the side, it's a cube.
But with a volume = 8000 and side = 20 you could think it is a cube. But it could still be a rectangular cuboid of 201004 sides.
I don't think it is mathematically possible to solve this.
By the way, im not a mathematician nor a programmer, so I would love to know if I'm thinking it the wrong way.
Loading more items...