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.
Solution, which takes 4 second for 10^8 will not pass I believe. It's pretty slow. Time limit on Codewars as far as I know is 6 seconds and the largest value in this kata is 10^9, so your solution will work about 30 second to resolve it. That's why you see timeout exception.