the function had better return an array, rather than nil.
Though, why do you think that would be better?
I agree with you and I implement such a version in the permute problem. This will make code more compact and convenient.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.