I have used policy based data str in this question.. but its no passing the last test case. why?

hello @abhi542136

here ur datastructure will discard duplicate entries because of which the expected answer will get changes.

use pair to make all entries unique and then it will work

Yeah… thanks… now its passing all the testcases

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.