Help me in solving CS09A problem

The code below is incorrect. Debug this code to solve this problem

t=int(input())
for i in range(t):
X, Y = map(input().split())
if X>=Y and (X+200)<=Y:
print(‘YES’)
else:
print(‘NO’)

Learning course: [Python for problem solving - 1](https://www.codechef.com/learn/python-beginner-v2-p1)
Problem Link: https://www.codechef.com/learn/BP00BP10_V2/problems/CS09A


kindly explain how and what is the logic of this code

map function takes two arguments, a data type and input value. Here, there is no data type present.

As per the given question, ‘Y’ ranges between [X, X+200] (both inclusive). This means ‘Y’ should be greater than ‘X’ but less than ‘X+200’, i.e.

X <= Y <= (X+200)

I believe this should clear any confusion regarding the problem.

1 Like