Help in finding error for the problem ZUBREACH

Hello Chefs,

Will you please help me in finding error in following code, every time it is giving WA for the hidden TCs!!
Problem link :
Submissions link :,nagesh_reddy

for t in range(1,int(input())+1):
    m,n = map(int,input().split())
    rx,ry = map(int,input().split())
    n = int(input())
    x,y,l = 0,0,input()
    for i in l:
        if i=='L':
            x -= 1
        elif i=='R':
            x += 1
        elif i=='U':
            y += 1
            y -= 1
    if x==rx and y==ry:
        dir = 'REACHED'
    elif x<0 or x>m or y<0 or y>n:
        dir = 'DANGER'
        dir = 'SOMEWHERE'
    print('Case {}: {}'.format(t,dir))

Find the difference :slight_smile:
My Solution
Your Solution

1 Like

Thanks for the reply, I found the mistake
Have declared n 2 times

Thanks bro and sure :hugs: :joy:

1 Like