No same Permutations

can you please tell how do i approach this

hey,you can use recursion here,suppose array numbers are 1,2,3 so apply recusrsion on 2,3 that is leaving first element,now recursion will give all permutations of subarray ,we assume that now store that answers now add 1 to the result of above recursion at all possible positions but take care of duplicates by checking that elements at current index and next index are not same.So recursion give 23 and 32 now add 1 to all possible positions.Hope you get it .`