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.
This is because you are trying to do the calculation of 'd' within the loop- you have to do it after 'a' has been populated completely.
Also, you have a typo when checking for v==8, a[i] == ...
I had the same issue. I was calculating based on the largest. Good question and explnation.
You can google "Python truncate to decimal places". I think the easy way to truncate is to take the
int
of "...". I am sure you will find what to put instead of "...".Asking for help is not an issue.
PS: did you read all the description?
Not a kata issue, your code is inefficient, and that's explained in the error message:
Well, actually it passes all tests before timing out, so there are more tests and your code doesn't pass them all.
Read this: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution#timeout
No need to be sorry, if I would not like to "waste" my time, I would not reply.
Don't worry, all of us were there.
This comment is hidden because it contains spoiler information about the solution