Help with approach

sol: https://ide.codingblocks.com/s/416571

prob: https://hack.codingblocks.com/app/contests/2022/381/problem

In the lecture we were taught to solve the problem using user defined pair class but in the problem they have already written the function using inbuilt pair class although the logic is same I want to use the inbuilt one please tell how do I change my code for the same

Hello @raghav007 this class is not inbuilt it is just they have written some part of the code for you anid they are asking you to complete the function.
there is nothing of inbuilt is used in this.

okay let me rephrase the return type of the function there is pair<int, bool> but in the lecture we were taught using user defined pair class, so it’s a bit confusing.

@raghav007 actually in this we have made the pair type because we have to handle the two parameters only i.e height and boolean value.
you can do this by class as well but class is generally taken when we need more parameters then 2.

How do I do it without using the user defined pair like I did it in my code

check this:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.