Python Partially correct: is there any other problem with this code other then time limit?


#1

class Solution:
# @param A : string
# @param B : string
# @return an integer
def isMatch(self, A, B):
dp=[]
for i in range(len(B)+1):
t=[0](len(A)+1)
dp.append(t)
dp[0][0]=1
for i in range(1,len(B)+1):
if B[i-1]==’
’:
dp[i][0]=dp[i-1][0]

    for i in range(1,len(B)+1):
        for j in range(1,len(A)+1):
            if A[j-1]==B[i-1] or B[i-1]== '?':
                dp[i][j]=dp[i-1][j-1]
            if B[i-1]== '*' :
                dp[i][j]=max(d-1][p[ij-1],dp[i][j-1],dp[i-1][j])

           

    return dp[-1][-1]