Incorrect solution for particular test case


#1


def solve(self, A, B, C):
total_num = 0
if(B == 1):
for i in range(0,len(A)):
if(A[i]<C):
total_num+=1
return total_num
if(10**(B-1)> C):
return 0

    for j in range(1,B+1):
        n = C//(10**(B-j))
        n = n%10
        count_first_digit = 0
        for i in range(0,len(A)):
            if(j==1):
                num = 1
            else:
                num = 0
            if(A[i]>=num and A[i]<n):
                count_first_digit+=1
        if(count_first_digit==0):
            return total_num
        total_num += count_first_digit* (len(A)**(B-j))
    return total_num