getting wrong answer in ambiguous permutations
i don’t know which test case is this code failing on?

sum+=temp*pow(10, n-i) . See the constraints of the problem. n can be 100000. What about 10^100000 . It is a 100001 digit number. You expect this big a number to be stored in an unsigned int? Nope, you need a different approach. FYI, maximum 18-19 digits can be stored.