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.
got it, thanks
Your code is mutating the input, and you're printing it after it was mutated, print it before doing anything else.
When testing (javascript) I got this error for [3,2,1], expected 0 but got 1, isn't it supposed to return index 1 because 2 is the number that fits between 1 and 3? Also for [3.2,2.1,1.4] expected 0 but isn't 2.1 between 3.2 and 1.4?
i agree for this solution. i'm never thinking this before. thanks
could add it but null undefined etc are not booleans
The idea is that booleans only have two values. true and false. If the entered boolean is true it outputs "Yes" if the entere boolean is false it outpits "no" There isnt even any calculation required here. It just directly returns Yes or No depending on whats entered.
yeah
the Array.toSorted() method wasn't working so i checked the data type of the triplet and it showed that it was an object but in the description it said that the input will be an array.
Neat! Very clean.
Unrelated: reading your solution made Big O notation make sense to me. :)
Every item in the incoming array is processed twice, first to remove everything that's equal to or greater than zero to a fresh array, and then to sum every element of that new list. Every item is essentially touched twice so it's O squared, but technically maybe it's kind of smaller than that in an ideal case because the reducer only does its work on the resulting, probably smaller, subset of filtered numbers.
Thanks, I know this is sort of unrelated, I just needed to go off for a sec.
me too... good :D
Ohhhh, thanks, nice explanation
If you pass 0 to the function, it will return -0 yes, but when you try to display -0 (for example, with console.log(-0)), it will appear as 0. This is because JavaScript generally doesn't distinguish between 0 and -0 in the output.
for initialitation
valeur a will begin with 0
like my solution hhhhh
Did it the same way
Loading more items...