Thought the same thing. 0 + 0 was something I checked for before submitting, as I assumed it would have been tested given the need to eliminate leading zeros.
Because a and b are no longer strings. If you call a or b anytime after the split, you're referencing an array now, not the original string. Sounds like mutation to me.
If you wanted to return a string indicating a written sum, like "11 + 11 = 22", you can't because you no longer have any way of accessing the original input of 11 and 11.
The jealousy is strong here, lol. 'c' can easily stand for 'carry over' as that is exactly what it is used for. 'a' and 'b' are provided by the person who designed the kata in the first place, so that parts settled. 'res' could stand for 'residue', or 'residual', or wth cares. What even is this?
It's a Double NOT bitwise operator. So
~~undefined
or~~null
becomes a0
.A more readable approach would be to just use
a.pop() || 0
Amazing!Love it
Thought the same thing.
0 + 0
was something I checked for before submitting, as I assumed it would have been tested given the need to eliminate leading zeros.Because
a
andb
are no longer strings. If you calla
orb
anytime after the split, you're referencing an array now, not the original string. Sounds like mutation to me.If you wanted to return a string indicating a written sum, like
"11 + 11 = 22"
, you can't because you no longer have any way of accessing the original input of11
and11
.https://stackoverflow.com/a/5971668/8784518
https://stackoverflow.com/a/32608094/8784518
What are those
~~
?This comment is hidden because it contains spoiler information about the solution
I didn't understand the solution for first time. But it's perfect.
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 is cool and clever, but it is FAR from best practices. The code isn't easily readable.
Jesus Christ it's Jason Bourne
The jealousy is strong here, lol. 'c' can easily stand for 'carry over' as that is exactly what it is used for. 'a' and 'b' are provided by the person who designed the kata in the first place, so that parts settled. 'res' could stand for 'residue', or 'residual', or wth cares. What even is this?
The part that seems to be the crux is using remainders to compute a sum. I have never seen this. Very super duperly.
This is cool
Loading more items...