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.
Я этого чара родственник!
Good practice is always based on use-case. In this case, the function has a simple purpose.to sort the input array. Since the intent is straightforward, there’s no readability issue. Additionally, if we're dealing with a potentially large array, our approach is to optimize for performance and avoiding unnecessary memory allocation. What is "good practice" is always based on context.
The point is that it's bad practice to mutate input. Undocumented side effects like that are hell on readability.
Just ditch the Linq, at least in this case. Slow as molasses. My code is readable, maintainable, and executes 2.5 to 3 times faster. Linq is too often a crutch for lazy coding.
@gaelanmcmillan: "People love a compact Linq solution" to the detriment of all. Most of those compact solutions are significantly slower to execute. Simple loops, while more verbose, will usually be better in execution speed, and much, much easier to read and maintain.
That code takes 2.5 to 3 times as long to execute compared with mine. That is significant.
What is your point?
This comment is hidden because it contains spoiler information about the solution
You missed the "non-negative integers" requirement.
From the description, it is not expected to. but yeah it doesn't.
im late, but nice!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
what is forged clothes?
Thanks for this kata. 2 years ago, I had this kata bookmarked because I couldn't solve it. I forgot about it for years. Tried again today and solved it in under 30 minutes.
Can any one tell me why my code required increasing recursion limit to pass all test while many other recursive solution didn't? Really looking forward to the answer.
Great Kata, Thanks leakymirror
Loading more items...