Error in problem :THEATRE

Please help me find the error in my solution for problem:THEATRE asked in FEB long challenge.
It is giving correct output for the given test cases.
My solution:

I would suggest you to try and find the issue yourself. Re-read the question again and try and make your own test case
I’ll give you a test case where your code fails.

Input :

A 12
B 12
B 12

Output of your code :


Expected Output :


1 Like

ohh thanks.Got the mistake I was making.