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.
OP solved it, closing
Oh on second time i did it.
I have no idea why this works. My math is subpar, so I can't really explain, but it this is definitely way above my level.
very fun!Good job!
Let's entertain the possibility that it's too difficult and that a simple loop should work. Well then, we might as well delete the kata, because there's nothing left of it.
If a 6-year-old can figure it out, then so could they. It isn't hard for someone with semi-functional brain at all. If it is, maybe they're in the wrong place.
This is by definition optimization and not something for absolute beginners. It really is a simple solution, but this would stump beginners who haven't been exposed to that.
Edit- Look at all the comments made by 7kyu coders who don't understand why their code is timing out, and the responses. "Find a faster algoritm." "The kata is tagged performance for a reason."
This really is a little hard on the new coders. Simple doesn't mean for absolute beginners.
I have to agree, it's not even "optimisation" its like year 6 maths.
I'm actually tempted to argue that the "optimised" solution is actually easier than doing it some slower way, as well.
That depends on the values tested.
I get Timeout Error but when i test my code,it will be passed.