An example of terrible implementation of a classic exercise.
It's a terrible idea to require an exact sequence of elements as a result. Why didn't you implement sorting of results before comparison?
What is the reason for returning [] when k > len(indices). In such case there are no permutations which can be produced, so the result should be an empty list of permutations.
Indeed, as everything(ranks, test validations, number of tests) is terrible.
For more information on this look at YouTube, Cory Shaffer - "Python Tutorial: Comprehensions - How they work and why you should be using them"
Function name should be in snake_case in Python.
O, it's nothing ;)
you are very clever
OK, I can now answer my own question.
This means there was a segfault.
Read more here.
This comment is hidden because it contains spoiler information about the solution
I keep getting Error 139 (when running sample tests and the actual tests) -- has anyone else run into this problem?
I'm quite astonished someone validates this kata, still a beta one for me.
Everybody is using itertools or functools for this kata (which I use too, for more complex tasks), but since the only request in this kata is to generate the permutations, I thought that I'll do it in the old fashioned way - and had some fun in the process :)
filter and list comprehension are exactly the same (in terms of algorithms)