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 think this solution is very readable compared with others, which is a huge plus.
Nice. This was most similar to my solution. Don't completely understand the syntax of the #1 solution for this problem. But in the meanwhile, this is great. Thanks!
This comment is hidden because it contains spoiler information about the solution
ı like it
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Nice solution. Gives me new idea to solve a problem.
Thanks all.
hey, a little note here,
you can still add arrow function at reduce
you probably forget arr.length - 1 instead of arr.length
This comment is hidden because it contains spoiler information about the solution
parseInt really needs a radix passing to it: although base 10 is assumed it's good practice to ensure that parameter is always passed, eg.
parseInt(x, 10);
Because arr[i] still needs to be counted - which would not happen when the If statement fails. This is especially important in this challenge where the value you want to return may only appear once.
Since the array is sorted first, incrementing num in the else statement is the equivalent of saying "This is the last time this number appears in the array, let's see if it showed up an odd number of times."
This comment is hidden because it contains spoiler information about the solution
unsure why the else statement is incremeneting num?
if arr[i] !== arr[i+1], then why are we continuing to count num?
new road for me!thx
Loading more items...