Beautiful. This certainly is more efficient for examples like the one you've shown (2018 - 779), but what about (2018 - 9)? I wonder what method is the most efficient on average.
You are viewing a single comment's thread from:
Beautiful. This certainly is more efficient for examples like the one you've shown (2018 - 779), but what about (2018 - 9)? I wonder what method is the most efficient on average.
If forced to write out the steps, then the old method is definitely faster for an example like 2018 - 9. But I would argue that you shouldn't require any algorithm to solve that one ;).
For typical elementary school puzzles, the difference in effort required to carry out the calculations is negligible, in which case the old method may be preferable, because it's more obvious from the writing what is going on. As the number of digits increase, I believe the amount of extra time required increases less with my method.
I wodered that because I was thinking about more efficient ways to write programs that perform arithmatic.