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.
It's not O(n^2) ya doofus. It's O(n * k), where n is number of splits, and k is the select (or vice versa). It's still very time complex, but it doesn't grow by the number of splits squared.
I love how elegant this solution is
just stepped through your code with pen and paper and this is so satisfying.
This comment is hidden because it contains spoiler information about the solution
I can see that there is a lot of negative opinions about this approach but I am still quite new and still learning so I could someone please explain how this approach even works? I'm not really able to see the connection between how i's sorted ascending order matching the reversed order of n produces the right result...
Thank you in advance for your time and help!
Sorry but at this level a brute force solution IMO it's not Clever or Best Practices.
My solution it's simple and clear.
Does the use of a length 1 array in
text.Split(new[] {"\n"})
have any special benefit or purpose compared to
text.Split('\n')
?
how does rot13 work on all unicode?
how do you chain ternaries like that wtf?
wow, goddam this is so good
Very interesting approach
Hmmm...
Pretty graceful.
My solution is far from this.
I agree with predecessors. This solution is not very good in terms of performance for some nastily chosen input data.
Consider n = 10999999999 and try to see how long your 'for' loop would take to reach 19099999999.
This comment is hidden because it contains spoiler information about the solution
I like it. I am not sure about the performance of this solution. Are you sure that usage of sorting is the best practice? I am a new user on Codewars. It is not clear for me should we take the performance into consideration?
Anyway, I use GroupBy for word and words. And compare groups. May it provide less execution time?