This comment is hidden because it contains spoiler information about the solution
I'm assuming you are attempting it on JS. That's weird, because I just submitted my JS code (Simple approach) and passed all the test. Edit: Oh you just passed the test
help me!
2066 5 expected 5 to equal 9
2+0+6+6=14 => 1+4=5? why 9?
16257 3 expected 3 to equal 9
1+6+2+5+7=21 => 2+1=3 why 9?
you're right, it's useless here. just before I solved a similar kata, where was also necessary to remove duplicates. So I did it automatically.
Why did you use a Set here? If you were given an array like [1,2,1,3,"a"] it would return [1,2,3] instead of [1,2,1,3]
cheers Jo :)
Loading collection data...
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I'm assuming you are attempting it on JS. That's weird, because I just submitted my JS code (Simple approach) and passed all the test.
Edit: Oh you just passed the test
help me!
2066 5
expected 5 to equal 9
2+0+6+6=14 => 1+4=5?
why 9?
16257 3
expected 3 to equal 9
1+6+2+5+7=21 => 2+1=3
why 9?
you're right, it's useless here. just before I solved a similar kata, where was also necessary to remove duplicates. So I did it automatically.
Why did you use a Set here?
If you were given an array like [1,2,1,3,"a"] it would return [1,2,3] instead of [1,2,1,3]
cheers Jo :)