Given a set of integers, return all possible permutations that contains duplicate.

Consider example [1,2,2] returns

[1,2,2],
[2,1,2],
[2,2,1]

This problem is classic example of backtracking. If there are duplicate elements, the total number of elements are n!/(k!z!) where n is the total number of elements and k,z are duplicate count for an integer.