GUVI
Back

Need a small help regarding this (Q.no 30 in matrix), fails in one test case,

Created 3 years ago
36 Views
1 Comments
saran
@saran
saran
@saranProfile is locked. Login

I have actually coded this question with respect to the question, but fails in one test case please help,

main = []
for i in range(4):
  main.append(list(input()))

a = int(input())
for i in range(a):
  x, y = map(int, input().split())
  if x == 3:
    if main[x][y] == "#":
      print('-1')
    else:
      print('0')
  else:
    if main[x][y] == '.' and main[x+1][y] == '.':
      print('1')
    elif main[x][y] == '.':
      print('0')
    else:
      print('-1')

Comments
Please login to comment.
 
Powered by habitate.io Habitate