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.
Because you want the count of the positive numbers. Each x that is positive gets represented by 1 in the new array. A sum of the array with 1s is essentially a count of the positive numbers.
This comment is hidden because it contains spoiler information about the solution
Thanks for your observation, I will try to learn more about this.
i did not get the 1 for x why 1 ?
Thank you for this interpretation, it made this line seem less crazy to me.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
It's pretty readable to me, what do you find so hard to read?
I'm kinda surprised that this is marked as best practice. It's very non-trivial, but the logic used is too paradoxical for this code to be readable.
Completely agree! This solution is smart, but too non-trivial to be readable imho.
I liked this solution better that the one at the top, this one seems more readable to me.