Different output for same code and same input on using "test" and "test with custom input" button


#1

My code in python 3
Please tell me its the compiler problem
It is giving correct output for this input when using “test with custom input”
x=0
class Solution:
# @param A : list of integers
# @param B : integer
# @param C : integer
# @return an integer
def solve(self, A, B, C):
global x
c=len(str©)
a=len(A)
if B==0:
return 0
if B==1:
for i in A:
if i<C:
#print(i)
x+=1
else:
break
#print(“returned”)
return x
if c<B:
return 0
elif c>B:
if 0 in A:
return (a**(B-1))*(a-1)
else:
return (aB)
else:
for i in A:
if(i<int((str©[0]))):
x+=a
(B-1)
return x
elif i==int((str©[0])):
if c==1:
if 0 in A:
return x-a**(B-1)
return x
d=int((str©)[1:])
x=x+self.solve(A,B-1,d)
else:
if 0 in A:
return x-a**(B-1)
return x