# Aleksey Kladov - Generate All the Things (Highlights) ![rw-book-cover|256](https://readwise-assets.s3.amazonaws.com/static/images/article1.be68295a7e40.png) ## Highlights - On each iteration, we will remember the sequence of numbers we generated together with bounds the user requested ([View Highlight](https://read.readwise.io/read/01kb9eha485dwdg95ay21qrqnm)) ^962128987 - In the first iteration, create memory for each invocation. - User will cann `done()` to see permutation has done. Use the function to update memory for the next iteration. - Following iteration will use memory to provide values for each invocation. - As we store zeros implicitly anyway, we can just truncate the vector in `done` instead of zeroing-out the elements after the incremented one. ([View Highlight](https://read.readwise.io/read/01kb9eygjzyxsn8q2wkrqdyf8n)) ^962129768