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.
You're asking programmers to not explain why bad code is bad.
Great kata of the bowling series, well done.
I knew it! (There is should be an elegant "python" way to do that)!
Wish I had done it this clean!
damn, forgot this method exited haha
i like how every comment is just "this is not best practice!!!"
guys, chill
The count method is called for each unique character in the text, leading to an overall time complexity of π(πβ π)
O(nβ m), where n is the length of the text and π is the number of unique characters. This can be inefficient for large texts.
This comment is hidden because it contains spoiler information about the solution
OP solved it, closing
OP solved it, closing. (Your initial code will not work for odd number of chained calls)
This comment is hidden because it contains spoiler information about the solution
What is the added value of defaultdict in this scenario?
same! :D
In one line but for what price... The code is terribly inefficient. Your solution has more lines but it is faster and cleaner.
Absolutely not best practice. Number of instances of one character is something you can very easily do with just one iteration over the string. This code goes over the entire string for each character unnecessarily.
I really wish newbies shifted their efforts from making "fancy" one-liners with terrible efficiency to writing actual respectable pieces of code. And I also wish people stopped upvoting codes like these as "Clever" or even "Best Practices".
Loading more items...