Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Your solution is very short, but is not effective. Because, to calculate one permutation, the algorithm will calculate all possible permutations and return one.
Clever use of Python's built-in
itertools
module - you successfully reduced the code in the original Kumite from an entire class to a single method utilizing a simple built-in method :) In response to your concern regarding the purpose of Kumite, don't worry - you've got it absolutely correct :D However, while Python classes are inPascalCase
by convention, Python methods (and variables) should always be insnake_case
as per PEP 8 so yourSequencePermutation
method should be renamed tosequence_permutation
.