Chef and Digits of a number

I made the following program but after submitting the code it shows that the answer is wrong, and I can’t understand why, since I checked the answers for some test cases and they were correct. Please have a look at the code and suggest some solutions.

t = int(input())
for i in range(1,t+1):
        n = int(input())
        f_n = [int(d) for d in str(n)]
        count_one = f_n.count(1)
        count_zero = f_n.count(0)

        if (count_one == 1 or count_zero == 1):