MathWorks Interview Question

Python program requiring backtracking to find permutations. I have used Python but the syntax is not on my fingertips. Most of the time, I spent in remembering the exact syntax and built-in functions.