class Solution:
def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int:
l1=[]
if obstacleGrid[0][0]==0:
l1.append(1)
else:
l1.append(0)
for idx in range(1,len(obstacleGrid[0])):
if obstacleGrid[0][idx]==0:
l1.append(l1[idx-1])
else:
l1.append(0)
for row in range(1,len(obstacleGrid)):
print(l1)
for col in range(0,len(obstacleGrid[0])):
if col==0:
if obstacleGrid[row][0]==1:
l1[0]=0
else:
if obstacleGrid[row][col]==0:
l1[col]=l1[col]+l1[col-1]
else:
l1[col]=0
return l1[len(l1)-1]
my runtime and memory usage for python is coming very poor , below 10%,is there something wrong with my logic or i am not using python effectively???