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.
Solve using mathematical formula instead of using Loop. Execution of loop takes time. and the solution using Math formula execute less than a millisecond even with big numbers.
https://www.codewars.com/kata/reviews/516f30247c907a79f200033c/groups/5d5981356b760900015e54e5
best solution.