Hi,
Can u try to solve using the attached pseudocode explained in the lecture.
I am trying to explain for one case.
Case I: SubjectTopper(X, 0, 0, 0)
So in this case you are inputting marks of card X, MMark = 0, PMark = 0 and CMark = 0. Now consider if condition in pseudocde:
if (Card.Maths >= MMark or Card.Physics >= PMark or Card.Chemistry >= CMark). In this case to go inside if block anyone of the statement should be correct.
It will be true if one of the statement will become correct. Now let us consider the worst case that Card X has 0 marks in all subjects. So when you will compare Card.Maths >= 0 and other two statement will give true condition. Therefore code will go inside if block and return True.
Now try to solve other two cases by yourself. If you have still doubt please write us again.
Regards,
Deepak
IITM Online Degree Team