Help! WA in Python

I need help in a Python code.
The problem is https://www.codechef.com/IARCSJUD/problems/PYRAMID

my code link is https://www.codechef.com/viewsolution/37173313

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: https://www.codechef.com/viewsolution/37174368

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

3
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: