private void _permuteUnique(int[] num, boolean[] visited, ArrayList<Integer> list, ArrayList<ArrayList<Integer>> results) {
        if (list.size() == num.length) {
            results.add(new ArrayList<Integer>(list));
            return;
        }
        
        for (int i = 0; i < num.length; i++) {
            if(visited[i] == true || (i > 0 && num[i] == num[i-1] && visited[i - 1] == false)) {
                continue;
            }
            list.add(num[i]);
            visited[i] = true;
            _permuteUnique(num, visited, list, results);
            list.remove(list.size()-1);
            visited[i] = false;
        }
    }