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.
Ah, hence the inline.
I was wondering what it was for, thanks :)
I guess the compiler automatically changes 21**n in the result.
The total of the resulting list doesn't really adds up to 360, just close to it.
The tests sometimes throw an exception:
I cheated and bypassed the kata security to use the random module. :)
2*n == n*2
Yours seems slightly faster indeed, but around 10-20% depending on the size of the list.
And partly because of the extra layer of itemgetter.
For example with the same random tests as the kata and the same list of 1_000_000 tests for each one, I get the following results:
Mercy: 3.399389314651489 seconds
Oleg: 3.032890796661377 seconds
rowcased: 3.238804864883423 seconds
And while obviously not unreadable, your code takes just a little longer to get for a newcomer.
This comment is hidden because it contains spoiler information about the solution
In sample tests, you have
-21x+(-12)y=4
instead of-21x+(-12y)=4
The
y
inside the()
And I took that personally so I optimized it in a fork.
Unfortunately, it did end up looking like falsetru solution. :/
Great minds think alike xD
It is a bit overkill for this kata.
'(CO3)3(PO3)2' should equal 'CO33(PO3)2'
'(PO3)2(CO3)3' should equal 'PO32(CO3)3'
I disagree.
bisect gives the position in a sorted list to insert a new element and keep it sorted.
Like the name suggest, it uses a bisection algorithm so it's faster than just checking the list one by one.
The difference between left and right is when the element is already in the list since you could add it to the left or the right and keep the list sorted. It's needed because the range is inclusive. :)
This comment is hidden because it contains spoiler information about the solution
You have a problem in your tests, check my "solution".
Clever x)
Never made a kata so I don't know much about how the tests work (beyond the basics) :)
Loading more items...