New answers tagged combinatorics
3
I would suggest breaking the actual permutation algorithm out into its own function, since it’s useful on its own. That would pretty much solve the readability problem.
And then I would suggest doing the permutation with indices, rather than copying the whole input vector. (Indices would also work for other range types, especially if you limit the input ...
Top 50 recent answers are included
Related Tags
combinatorics × 449python × 133
algorithm × 117
java × 104
performance × 94
programming-challenge × 67
c++ × 64
recursion × 46
strings × 41
python-3.x × 32
beginner × 31
c# × 29
time-limit-exceeded × 29
javascript × 22
c × 21
array × 21
c++11 × 16
python-2.x × 14
haskell × 14
interview-questions × 12
complexity × 12
mathematics × 11
functional-programming × 9
comparative-review × 9
reinventing-the-wheel × 9