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

I think both those cases happen with a certain frequency, yes, your last element is a bit trickier, though in Python it is represented by A[-1] (so that would turn into A[len-1])

Yeah, maybe there's no fundamental advantage, one would have to check the most common cases.

> Why would you need to "wrap around" an array?

Ring buffers



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: