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.
"oh yeah duh" - me
It can only remove both sides '0'.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
He uses the flag at the end re.I which makes the regex case insensitive.
Fair enough.
No this is still pointless. If you have to optimize something for fib numbers, that's absolutely not what you have to do. What you should do to get better performances is first to change the complexity of the algo. Meaning, garbage the whole code and use the fastest known.
"Do never mocrooptimize the code with a bad time complexity".
And second point, either we didn't understood each others, or your point isn't logical: you're talking about optimizing the very first step. 1 over, let's say, 1000. The thing is, the time of computation of fib numbers grows with their size. So let's imagine that the very first step is 1000 time faster than the last one (and I'd bet on a really low estimation), so you're optimizing, by 10-20% something that represent less than 1/1 000 000 of the computation time (and here again, this is a very low estimation, since I didn't take into account the time of the terms in between. So it's certainly more something like 1/10e9 that we should have in mind). Still worthless.
Yes, Yes I am. Optimizing any part of code is not at all pointless. You can easily use the code above to calculate fibonacci numbers to over 10^1000. But on a big enough timeline with a big enough number that little change could save hours or days.
Far as I'm concerned, it's never a bad thing to optimize even further.
Seriously? :o
This is non sense! You're talking about a mircooptimization that will give you 10-20% better speed on the first single operation of... how many others? hundreds? thausends?? Because even if it's not the case in this katas, that algo is used to produce rather big fib numbers (even if there is another algo that is faster). So the optimization you're suggesting is just totally pointless...
This comment is hidden because it contains spoiler information about the solution
LOL In python it literally says to make your own examples... wtf.
I have to agree with others, this certainly does not deserve to be a lvl 6. lvl 7 max.
This comment is hidden because it contains spoiler information about the solution
Hey, would you mind posting your code formatted in Markdown or at least post the error (expected and actual), so I can see what the problem is.
Loading more items...