To solve this problem, we'll take 3 different approaches.
Enjoy the video ππ
Also written version https://losseff.xyz/katas/016-count-of-positives-sum-of-negatives/javascript/
We're a place where coders share, stay up-to-date and grow their careers.
To solve this problem, we'll take 3 different approaches.
Enjoy the video ππ
Also written version https://losseff.xyz/katas/016-count-of-positives-sum-of-negatives/javascript/
dip vachhani -
PrimeTek -
Taranpreet Singh -
Alex Devero -
Discussion (2)
With only a reduce:
EDITED: now should work
I like your approachπ Thanks for sharing itπ
I though about reduce, but for some reasons didn't give it a shot.
But this solution won't pass the tests. It'll always return [0, 0]
I assume you made a few typos, it happens to me all the time))
I'd change it like this:
I think it might look like this.