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.
Approved by author secretly
I looked at your solution. I am rather sure that the problem comes from your division (division introduces an added error, error "multiplied" by a multiplication) in your calculation of "newAvg". I re-wrote that line and then your solution passes every time.
Thanks for your work! I see that you finally passed the kata. The description says:
The answer must be an integer so I don't see a reason to use a tolerance.
To get "navg = 115053.00000000001" I suppose that in a first approach you didn't round up(?).
Sorry I didn't understand your post.
When I wrote: Substrings in the input string are separated by
,
or,
" I didn't mean that in each language there would be the two types of separator; I meant that the types could be one or the other depending on the language. It happens that Kotlin has the first type of separator and Swift has the other type. Anyway with a regex (as yo did) the difference is not a problem. I added that sentence after a post from ByteEater that you can see below.They are ... (comma + white space). Maybe you didn't see the white space after the comma in description?
Look at "Sample tests" and you will see.
Before posting issues look at the top of the page to see how many people passed the kata in your language. If there were problems somebody would have said them before you. Cheers and good luck!