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.
I'm going to learn it. Thank you!
why complicate a simple problem with sanity checks
actually a pretty simple problem, only issues some people might have (myself included) is just not reading the problem carefully. At first I thought I had to check if input was an array of null, and I thought 0 was counted with the positive numbers. just read the question and read your code, you'll figure it out.
Clojure Translation
great!
there is always a easy way.
Your code being wrong is not a kata issue.
What a stupid resource solution , Not accuratte at all !
Because you should return their count and not their sum. Please, read the title again.
it has issue with sum of positive numbers
Nice! The ternary expression makes life way much easier.
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.
If this was a job instruction from a boss. Sure. Definitly.
But as a puzzle and training to make ourself better programmers? Nah, was good the way they did it.
Would inner join not be best practice in this example? You risk not capturing a particular record in the output table in the event of the department table not being kept up to date. I think a left join would be more appropriate.
The point is that it's bad practice to mutate input. Undocumented side effects like that are hell on readability.
Loading more items...