Unique path 2(Leet code)

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???

Can you share the code by saving at the given below link -

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.