SoFi interview question

Generate all permutations of a given integer array using backtracking