Output all permutations of size n.
Implement def generate_permutations(n): to return every permutation of [1, 2, ..., n] exactly once, in lexicographic order. Return a list of lists; for n = 0, return [[]].
Examples: n = 3 returns [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]; n = 1 returns [[1]].
Constraints: 0 <= n <= 8; the output contains exactly n! permutations.
def generate_permutations(n):