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)
You're asking programmers to not explain why bad code is bad.
this is literally so hot
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
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".
I made it so complicated! This solution is awesome!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Nice solution!
This comment is hidden because it contains spoiler information about the solution
it is not even a program. you just compressed your code into a few lines to make it look cleverer, instead it became unreadable and messed
good idea!
Loading more items...