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.
Guys, I get it now, you guys, it's like my magnum opus. None of the all my mental diarrhea, that I occasionally dare to call 'code', will be better than this. Nothing will exceed that. This is my 5th symphony.
And since I am about to get laid off from my current dead end job, perhaps someone out there might want to hire me? I prefer highload stuff, cause, as you can see above, I know how to optimize things.
Microsoft? Amazon? Hellooo.
You can find me in a cardboard box under the bridge. Or github. Now if you excuse me, I'll go back to looking for food in those trash bins.
Dem oneliners, mane.
Indeed, my friend.
Didn't know that (or forgot). Converteted to string just to be sure, cause too lazy.
Thanks for your elaborate comment. I recall my intention was to make it raise an exception at an init phase whenever it recieved an incorrect value. Didn't know it could be done with setattr. And you're right about bad pracitce, I am all about it when there is object stuff (⊙_☉)7
For
string = '1234'
,[...string]
will return['1','2','3','4']
Try it yourself
Also: javascript spread operator
Woah. I now feel bad that I published this. Do I get points for worst practice solution?
Python version doesn't let the tests pass if
findall
was not imported.Please add example tests and more tests in general. One is not enough.
https://docs.python.org/2/tutorial/datastructures.html#dictionaries
You're welcome. I too made the same mistake at first.
I think more random tests should be added for this kata, or at least an example test, which covers the case when word consists of zeroes and ones only.
According to kata description
Each number is a code that alternates in a pattern between encoded text and a smaller, encoded number. The pattern's length varies with every test, but the alternation between encoded text and an encoded number will always be there. Following this rule, each number tested begins with encoded text and ends with an encoded number.
it isn't.
This comment is hidden because it contains spoiler information about the solution
Thanks ☺
Can't pass 22nd test if
groupby
was not imported.Loading more items...