Meta interview question

Permutations , a leetcode medium