title: Algorithm to list all unique permutations of numbers contain duplicates
body: <p>The problem is: Given a collection of numbers that might contain duplicates, return all unique permutations.</p>
  
  <p>The naive way is using a set (in C++) to hold the permutations. This takes <em>O</em>(<em>n</em>! × log(<em>n</em>!)) time. Is there better solution?</p>