Help! WA in Python

I need help in a Python code.
The problem is

my code link is

can someone please tell me what is wrong in my logic or code.

Help will be appreciated

guys please help!!

Well, my idea was slow but it worked:

I created a test case for which your program fails, hopefully it will guide you to the flaw in your logic:

2 5
2 2
3 4

Your code prints 2 though the expected output was 3

1 Like

@tanmay_garg thanks for the help. I understood what was needed to be done from your code.

Thanks a lot buddy :grinning: :grinning: