Timeline for answer to Generating all length-N combinations of all length-M sublists of a list, without repetitions by user2357112
Current License: CC BY-SA 4.0
Post Revisions
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 17, 2025 at 11:16 | comment | added | user2357112 | @Robert: Ah, that's a good name. | |
| Apr 17, 2025 at 11:16 | history | edited | user2357112 | CC BY-SA 4.0 |
Better argument name.
|
| Apr 17, 2025 at 10:26 | comment | added | Robert |
Since you support any iterables, not just lists, maybe rename sublist_length to window_length.
|
|
| Apr 17, 2025 at 3:49 | comment | added | Max | Yes, that is the way. "Fix" the first element, and consider any 2 other elements not further than 5-1 elements away, to avoid duplicates and produce all allowed subsequences. You can even do that quite easily "by hand", without itertools. | |
| Apr 17, 2025 at 3:00 | history | answered | user2357112 | CC BY-SA 4.0 |