TRICKY PERMUTATIONS
Given a string containing duplicates, print all its distinct permutations such that there are no duplicate permutations and all permutations are printed in a lexicographic order.
How to unique permutation using recursion
Divyam, initially u can apply the same recursive logic you use for printing different permutations, and then store the permutations in a string, and also maintain a boolean variable, and then simply check,
if(temp[i]==temp[j])
{
flag=1;
}
else if your flag is still 0, it means that it is distinct and hence u have to print that only.