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.
Don't worry about it. I solved this problem in two ways. First, classically, as I would do in a structured programming language, for example in Delphi - using a for loop and a condition. And then, for my own pleasure, in one line. Of course, it's better not to do this in real problems)
Very cool!
The visualizer only executes the first line of the code...
AMAZING!!! I don't know how people are able to think this way.
You're asking programmers to not explain why bad code is bad.
Coding requires humility. I figure my code will have to be fixed by someone else.
I initially thoght of this solution, but used the count method of a list. Yours is better to be honest.
Got basically the same thing. It's good to know heapq but for a simple logical task it's nice to be able to do it with no library, though I admit I was cringing a bit at my own till[till.index(min(till))], an obviously redundant and costly operation.
I ended up getting almost identical solution in my first try. Feeling super happy, though I believe this can be further optimized like handling case when n=1 and using more optimal structures like heapq.
This comment is hidden because it contains spoiler information about the solution
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
I didn't think it could be solved with a one-dimensional array, my two-dimensional array gets bad results when using min(), for example res = min([[0, 9, 9], [1, 1]]) after running res = [0, 9, 9]. Because 0 < 1
This comment is hidden because it contains spoiler information about the solution
Loading more items...