In the example code on for the Credit problem, it says,
Multiply every other digit by 2, starting with the number’s second-to-last digit, and then add those products' digits together.
Moverover, the example confusingly shows
For the sake of discussion, let’s first underline every other digit, starting with the number’s second-to-last digit:
378282246310005
This example is poor because I'm not sure if they're starting with the bold 0
on the right, or the bold 7
on the left,
moving on...
Okay, let’s multiply each of the underlined digits by 2:
7•2 + 2•2 + 2•2 + 4•2 + 3•2 + 0•2 + 0•2
While numbers can be ambiguous it would seem award to write an addition problem where the number on the left is the "last digit".
What's the last digit, the one on the left or the right.
- With
9 + 1
, the9
rolls over and we add add the0
digit to the left making it sound like the last digit, having come after the ten's place. - We read 123, from the left to the right and the last digit sounds like it's the
3
?