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.
I believe it's always 21
hi, thanks for the comment. your code does not work, but there is a small problem with the kata (error message is backwards) so you are producing the value 81, which should be 9
xD
Thanks!
using floating-point datatypes to handle money is a dangerous idea. money is a discrete quantity, you expect $0.01 + $0.01 to always equal $0.02. but with floating point numbers, this is not necesarily true, because they have a limited precision. depending on how you write your calculations, and the magnitude of the numbers involved, you can end up with things like $0.9999999999 instead of $1, which is very problematic
You can use integers instead to work with money. For example, you can consider that the actual currency is the cent. It allows you to store money amounts in an integer, since it has no fractional part (you cannot have less than 1 cent). This is akin to fixed-point arithmetic
It's index 217 in the original list.
Look at the lengths of the two lists, the expected is 504, the actual is 503. The actual list is missing the zero.
Something in your code isn't handling zeroes correctly.
It will help to run through the code by hand and think through what would happen if the input is zero.
Agree
You are missing a zero in the actual result, check if you if-else branch left that condition unhandled.
See the post below yours, if it was 8kyu, other people would complain it was too hard for an 8kyu kata, you can't make everyone happy. There is no much difference between 7 and 8 kyu, both are white katas for beginners.
The number of lines isn't a good measure of a kata difficulty.
Your function returns the values identified by
Actual
, so there's something wrong somewhere. It's impossible to help you more. I advide you to perform a good debugging session. This can help: https://docs.codewars.com/training/troubleshooting/Please read the docs: https://www.programiz.com/c-programming/library-function/math.h/sin,
sin
uses radians, not degrees. What your function has to do, doesn't matter. Do the conversion before using it, otherwise, you won't get the result you expect.It probably is this case:
The expected value is ok, your function is returning 0.
I don't know what's the problem with your code, but, without spoiling too much the solution, there's no need to calculate any angles...
Those 90 are radians, not degrees.
Please see if this paragraph helps: https://docs.codewars.com/training/troubleshooting#timeout