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.
original solution with dictionnary !
I think len(l[0]) would be faster (O(1) instead of O(n))
Oh, I didn't know putting brackets would keep the sepators in list ! Thank you !
This solution seems much better to be than the "best practice/clever" above ones. Lets vote for it ahah :)
Question however : you chose to say it was false if arr[i]>=arr[i+1], I chose to accept it, it seems both pass the tests ?
The instructions didn't say what to do if arr[i]==arr[i+1]
this one is more efficient than the one using sorted !
you could also compare arr[i] and arr[i+1] to avoid the use of a third variable.
slower than necessery, and you kind of loose all the interest of the kata ?
shouldn't it also return 0 if n is anything elses than 9 ? (juste trying to understand it correctly)
Yes don't worry I don't take it wrong :) I don't know standard at all !
I put the comment mostly for myself ahah :) to separate things (while I saw you put spaces).
Same about the return : I know this is useless, but I sometimes find it clearer. I didn't know it was against standard : thank you for teaching me that.
(Just to be sure : I didn't made the fork about refactoring/because of your presentation, my idea was "ah, he made the same than me (and you gave me the idea of generator, while I did a function) but mine is faster because of this check things, lets see if I can adapt his code to do so too.)
My fork was not criticizing your presentation, sorry if there where a misunderstanding here :)
good idea to stock previous node in a dictionnary instead of copying all path each time as I did !
It seems a little faster (not sure it is because of that, but I think so ?) with about 650ms against 700-800ms.
I needed some time to see why it was working : I was thinking "but you don't check that i is prime number", before I realize that if you start with 2 ans go up, then n can't be divided by non-prime numbers.
also, I made a very complexe solution to optimize time, but surprisingly the gain is not that big (I use maybe 75% or your time, so... maybe not worth the complexity !)
I assumed a so simple solution would be to slow and was wrong.
This comment is hidden because it contains spoiler information about the solution
test the encode function ot have an idea of what is going on
the test already written give hug hints !
you can also add some tests on your own.
What do you observe with aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?
what about bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ?
really fun, but I think maybe too easy for 3 kyu (more 5 or 4 kyu)
I like the "bird bird bird" effect induced by the choice of name ahah :)
Loading more items...