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.
Why on earth does nobody care to fix this kata? It is WRONG. When you want to beat somebody by one, you need to have ONE more point - not the exact same score, which is what the tests require you to do. PLEASE FIX THIS! Thank you.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Sorry, but this Kata is just weird. I do not understand the description. This is so unlogical and not correct. You can't just come with i and j without saying anthing about them... What is i? What is j?
Obviously you do know the count function - but why don't you also use it to count your duplicates???
How on earth is that a best practice? It cannot get any more complicated... :-)
This is definitely not a best practice.... :-)
I am sorry you feel offended. Not my intention.
I am a technical guy - and I like precise, good kata descriptions.
For example: "First let us count the frequency of each lowercase letters in s1 and s2"
You do know what a frequency is? It is "1/t" or something per time unit. Hz for example is a unit for frequency, meaning "1 per second". In this context, saying to "count the frequency" does not make any sense at all. It is impossible to "count frequency", anywhere in any situation. What you mean is: count the amount each lowercase letter. Time does not play any role here.
Sorry, but who voted this to be a "clever" solution? It is full of DO NOT DO THIS things, repetition, hard to understand code and it is not even short...
I actually do not know which people mark this solution as "best practice". Maybe the author himself?
This is NOT containing best practice approaches at all, it is actually containing many to be avoided constructs!
a) always avoid bare loops when there are other possibilities. Looping through all lowercase letters is completely unnecessary.
b) NEVER EVER use "continue" which is actually the even worse uncle of a goto.
c) the three concatenated ifs are awfull. Kotlin has a when clause!
d) do not use map access with !! to disable null checks! There's a reason why get might return null!
e) filtering chars on a String and then looking at the length simply is counting! So use count {...}!
All in all, this certainly works - but don't do that!
What an awkward description! It is so unclear und unprecise... this one should get a lot of rework! If you really think, examples "hopefully" make it clearer, please invest in a better problem definition...
...aux???
What is the "multiple number" of an Int?
Consider clean code principles like good naming...
I sincerely recommend to learn the basics of Kotlin. (and any language)
"getSum()" for an ArrayList?
a) Iterable.sum() does that job.
b) in Kotlin, we do NOT use ArrayList directly.
c) why do you have a list at all?? All that precious memory for ... nothing.
Please, return to learning the basics.
"step 1" is completely redundant...
And why do you go from high to low?
Loading more items...