Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.




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

Search: