QUESTION 1 — Permutations Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3]
Output:
[
[1,2,3],
[1,3,2],
[2,1,3],
[2,3,1],
[3,1,2],
[3,2,1]
] I will discuss 2 different thought processes and solutions for this question. Both approaches involve Backtracking. THOUGHT PROCESS FOR BACKTRACKING SOLUTION — 1 Let's revise the backtracking Brahmastr before moving on, as we will follow…