3 ms·
Aside from the fact that they are basically generating power sets, if you don’t need all the values at once, a better method would be to use a generator functio
by romellem 4y ago
Aside from the fact that they are basically generating power sets, if you don’t need all the values at once, a better method would be to use a generator function if all you are doing is iterating. That way you don’t need to create all the values in memory first.
A library that I like for this is https://www.npmjs.com/package/generatorics https://www.npmjs.com/package/generatorics although there may be more modern ones available.
- samatman 4y ago> Aside from the fact that they are basically generating power sets ! String diff calls for an M x N cost matrix and simple dynamic programming with tail calls (or you can unwind it into loops if you have to). Not... not power sets.