33 ms·
Say, you gave you two papers each with a column of numbers and an empty one for the result, and ask me to process them in the manner given. I would place them s
by Someone 15y ago
Say, you gave you two papers each with a column of numbers and an empty one for the result, and ask me to process them in the manner given. I would place them side by side, move B down a line, C up a line, then add them row by row.
The lining up is a matter of prepending the lists with some border values; then, use map to do the add. Finally, discard the edge cases.
- ahelwer 15y agoThat is a good analogy, thank you. It does seem to produce code that is more difficult to understand, however.