3 ms·
I don't understand why this trick is necessary. For 11x<number> you can just do 10x<number> + <number> which is easy until you get to 3 digit numbers, but even
by AlexandrB 15y ago
I don't understand why this trick is necessary. For 11x<number> you can just do 10x<number> + <number> which is easy until you get to 3 digit numbers, but even then continues to work.
- rdouble 15y agoSpeed. The "trick" breaks down the problem so there's always a simpler summation to perform. In half of the possible products, one only has to add the sum of the digits to zero. For the rest, just slot the 2nd digit of the sum where the zero goes, and add 1 to the first digit. Most people can do either of those two simple additions faster than they can do sums like 210+21 or 390+39. If one is already quick with the latter kind of addition, then the trick is unnecessary.