Skip to content

Resolve "Exercise C6.20"

Kevin Chong requested to merge 33-exercise-c6-20 into master

Adds the exercise to implement an algorithm to get all permutations by using stacks.

Instead of integers from 1..n, I have used permutations for a list of strings.

I've learned that python does not allow you to create a set of lists, as lists are unhashable. So instead we are now returning a set of tuples. I've left the input as a list, as a list allows for some easy manipulation (swapping, copying). This does however mean that the lists will need to converted to tuples before adding them to the set, I've added a hint about how to do that, however would that be enough?

Closes #33 (closed)

Edited by Kevin Chong

Merge request reports