Raintree interview question

All permutation of an array