Course · Section 10: A Closer Look at Functions · Lecture 137: First-Class and Higher-Order Functions
Implement `permutations(str)` that returns an array of **all unique permutations** of `str` in any order. Example: `permutations('ab')` → `['ab', 'ba']`.
+ 1 hidden test run on Submit.
Choosing each character in turn and permuting the remainder generates all orderings recursively.
Run your code to see results.