Hacker News new | past | comments | ask | show | jobs | submit login

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.




That is a good analogy, thank you. It does seem to produce code that is more difficult to understand, however.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: