Buggy python submission (verdict: Runtime Error):
H, W = [int(item) for item in input().split()]
grid = [[item for item in input().strip()] for _ in range(H)]

# print(H, W) 
# print(grid)

dp = [[0 for _ in range(H+1)] for _ in range(W+1)]
dp[0][1] = 1

for i in range(H):
    for j in range(W):
        if grid[i][j] == '#':
            pass
        else:
            dp[i+1][j+1] = dp[i][j+1] + dp[i+1][j]

print(dp[H][W])

Fixed submission:
H, W = [int(item) for item in input().split()]
grid = [[item for item in input()] for _ in range(H)]

dp = [[0 for _ in range(W+1)] for _ in range(H+1)]
max_num = 10**9 +7

def main():
    dp[0][1] = 1

    for i in range(H):
        for j in range(W):
            if grid[i][j] != '#':
                dp[i+1][j+1] = (dp[i][j+1] + dp[i+1][j]) % max_num
            

    # print(dp)
    print(dp[H][W])

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

H, W = [int(item) for item in input().split()]
grid = [[item for item in input()] for _ in range(H)]

dp = np.zeros((H+1, W+1), dtype='int32')
max_num = 10**9 +7

def main():
    dp[0][1] = 1

    for i in range(H):
        for j in range(W):
            if grid[i][j] != '#':
                dp[i+1][j+1] = (dp[i][j+1] + dp[i+1][j]) % max_num
            

    # print(dp)
    print(dp[H][W])

if __name__ == "__main__":
    main()

Fixed submission:
H, W = [int(item) for item in input().split()]
grid = [[item for item in input()] for _ in range(H)]

dp = [[0 for _ in range(W+1)] for _ in range(H+1)]
max_num = 10**9 +7

def main():
    dp[0][1] = 1

    for i in range(H):
        for j in range(W):
            if grid[i][j] != '#':
                dp[i+1][j+1] = (dp[i][j+1] + dp[i+1][j]) % max_num
            

    # print(dp)
    print(dp[H][W])

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

H, W = [int(item) for item in input().split()]
grid = np.array([[item for item in input()] for _ in range(H)])

dp = np.zeros((H+1, W+1), dtype='int32')
max_num = 10**9 +7

def main():
    dp[0][1] = 1

    for i in range(H):
        for j in range(W):
            if grid[i][j] != '#':
                dp[i+1][j+1] = (dp[i][j+1] + dp[i+1][j]) % max_num
            

    # print(dp)
    print(dp[H][W])

if __name__ == "__main__":
    main()

Fixed submission:
H, W = [int(item) for item in input().split()]
grid = [[item for item in input()] for _ in range(H)]

dp = [[0 for _ in range(W+1)] for _ in range(H+1)]
max_num = 10**9 +7

def main():
    dp[0][1] = 1

    for i in range(H):
        for j in range(W):
            if grid[i][j] != '#':
                dp[i+1][j+1] = (dp[i][j+1] + dp[i+1][j]) % max_num
            

    # print(dp)
    print(dp[H][W])

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
H, W = [int(item) for item in input().split()]
grid = [[item for item in input()] for _ in range(H)]

dp = [[0 for _ in range(H+1)] for _ in range(W+1)]
max_num = 10**9 +7

def main():
    dp[0][1] = 1

    for i in range(H):
        for j in range(W):
            if grid[i][j] != '#':
                dp[i+1][j+1] = (dp[i][j+1] + dp[i+1][j]) % max_num
            

    # print(dp)
    print(dp[H][W])

if __name__ == "__main__":
    main()


Fixed submission:
H, W = [int(item) for item in input().split()]
grid = [[item for item in input()] for _ in range(H)]

dp = [[0 for _ in range(W+1)] for _ in range(H+1)]
max_num = 10**9 +7

def main():
    dp[0][1] = 1

    for i in range(H):
        for j in range(W):
            if grid[i][j] != '#':
                dp[i+1][j+1] = (dp[i][j+1] + dp[i+1][j]) % max_num
            

    # print(dp)
    print(dp[H][W])

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

H, W = [int(item) for item in input().split()]

grid = np.array([[item for item in input()] for _ in range(H)])
dp = np.zeros((H, W), dtype='int32')
max_num = 10**9 +7

def main():
    dp[0,0] = 1

    for i in range(H):
        for j in range(W):
            if grid[i, j] == '.' and i > 0 and j > 0:
                dp[i, j] = (dp[i-1, j] + dp[i, j-1]) % max_num
            elif grid[i, j] == '.' and i == 0 and j > 0:
                dp[i, j] = dp[i, j - 1] 
            elif grid[i, j] == '.' and j == 0 and i > 0:
                dp[i, j] = dp[i-1, j]

    # print(dp)
    print(dp[H-1,W-1])

if __name__ == "__main__":
    main()

Fixed submission:
H, W = [int(item) for item in input().split()]
grid = [[item for item in input()] for _ in range(H)]

dp = [[0 for _ in range(W+1)] for _ in range(H+1)]
max_num = 10**9 +7

def main():
    dp[0][1] = 1

    for i in range(H):
        for j in range(W):
            if grid[i][j] != '#':
                dp[i+1][j+1] = (dp[i][j+1] + dp[i+1][j]) % max_num
            

    # print(dp)
    print(dp[H][W])

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

H, W = [int(item) for item in input().split()]

grid = np.array([[item for item in input()] for _ in range(H)])
dp = np.zeros((H, W), dtype='int32')

dp[0,0] = 1

for i in range(H):
    for j in range(W):
        if grid[i, j] == '.' and i > 0 and j > 0:
            dp[i, j] = (dp[i-1, j] + dp[i, j-1]) % (10**9 +7)
        elif grid[i, j] == '.' and i == 0 and j > 0:
            dp[i, j] = dp[i, j - 1] 
        elif grid[i, j] == '.' and j == 0 and i > 0:
            dp[i, j] = dp[i-1, j]

# print(dp)
print(dp[H-1,W-1])

Fixed submission:
H, W = [int(item) for item in input().split()]
grid = [[item for item in input()] for _ in range(H)]

dp = [[0 for _ in range(W+1)] for _ in range(H+1)]
max_num = 10**9 +7

def main():
    dp[0][1] = 1

    for i in range(H):
        for j in range(W):
            if grid[i][j] != '#':
                dp[i+1][j+1] = (dp[i][j+1] + dp[i+1][j]) % max_num
            

    # print(dp)
    print(dp[H][W])

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

H, W = [int(item) for item in input().split()]

grid = np.array([[item for item in input()] for _ in range(H)])
dp = np.zeros((H, W), dtype='int32')

dp[0,0] = 1

for i in range(H):
    for j in range(W):
        if grid[i, j] == '.' and i > 0 and j > 0:
            dp[i, j] = (dp[i-1, j] + dp[i, j-1]) % (10**9 +7)
        elif grid[i, j] == '.' and i == 0 and j > 0:
            dp[i, j] = dp[i, j - 1] % (10**9 +7)
        elif grid[i, j] == '.' and j == 0 and i > 0:
            dp[i, j] = dp[i-1, j] % (10**9 +7)

# print(dp)
print(dp[H-1,W-1])

Fixed submission:
H, W = [int(item) for item in input().split()]
grid = [[item for item in input()] for _ in range(H)]

dp = [[0 for _ in range(W+1)] for _ in range(H+1)]
max_num = 10**9 +7

def main():
    dp[0][1] = 1

    for i in range(H):
        for j in range(W):
            if grid[i][j] != '#':
                dp[i+1][j+1] = (dp[i][j+1] + dp[i+1][j]) % max_num
            

    # print(dp)
    print(dp[H][W])

if __name__ == "__main__":
    main()