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.
That's the problem I have now, haha. I only consider real life years...
I have to modify my function...
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
113 is what your function returned instead of 22, to see what the input is, print it, it'll appear above the test result, read this: https://docs.codewars.com/training/troubleshooting/
I've changed difference for distance to make it crystal clear.
Difference means: the result of subtracting one number from another. How much one number differs from another. From the title "Compare with Margin", the difference is going to be a positive number since you are comparing the the difference between the 2 numbers given and the margin. Say on the number line you have a point at -5 and another point at 6 and you are trying to see if the margin between the 2 numbers is less than 12. You would not say because -5 -6 = -11 and -11 is less than 12, you would get the absolute value of -5 - 6 and compare the two. It doesn't need to be explicitly written in the directions.
Do you know what margin means? When you measure something, and it's not an exact measure, the number is noted as X ± Y where Y is the margin or tolerance. With a difference of 8411 (or -8411) and a margin of 1339, does that sound "close" to you? Close -> distance.
-1272 < 7169, right? The difference between a and b is always positive (think about it like a distance, there is no negative distance). So if b > a you should compute b - a instead of a - b or always take the absolute value of a - b, your choice.
hey, I'm a litle bit stupid, but even I did it. In first view it seems harder than 8kyu, but its not true.