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 a math problem in fact, not solely programming.
Because the community decided so, and IMO the ranking is perfectly fine for this one!
m
This comment is hidden because it contains spoiler information about the solution
Very strange description, had same problem - maybe you should write something like "if there is duplicate of min/max, you should sum it to result"
This comment is hidden because it contains spoiler information about the solution
That will really help you in real world app developments, where an end user can write any input on your app or website :-). Hope it helps.
It's good habit to use data validation ig
Please read the description more carefully before you raise issues.
code has just one space as an indentation and python rule is 4 spaces or tab
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
my bad, it's fixed now
Even
+
or-
with floats could lead to those errors. So, not the best choice here.@Garce well in general when people ask questions it's because they want to solve the kata, so since you solved it it usually means you resolved your own question.
Alternatively, if you wanted a detailed explanation of your error, then you should post your code with spoilers rather than just 1 result from tests, because otherwise how can people guess why your code isn't working?
Re-reading your question, if you are getting floating point errors on a kata which involves counting elements, then it probably means you are introducing unncessary arithmetic operations like
*
or/
so that would be my guess why you get these mistakes (the kata is testing for strict equality since your result must be an item in the actual list - your current approach finds a value that is very close to a another value that is in the list, but does not actually appear:9.999997563348018e-08
is indeed close to1e-07
numerically, but it appears 0 times in the input list so it is not the unique number)Loading more items...