Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren0
How to write my permutation generation function? Help!
How to write my permutation generation function with python? Help me please..
2 Antworten
+ 3
There is already a function `permutations()` in the 'itertools' module in Python. Why not use that?
https://docs.python.org/3/library/itertools.html#itertools.permutations
If you want to implement it yourself, you can maybe use Heap's algorithm
https://en.m.wikipedia.org/wiki/Heap%27s_algorithm
+ 2
Idk what those words mean off the top of my head. But include the math in the problem and link your attempted code in the description as well.