CHEFRECP showing wrong answer

Anyone help me where this fails. I am not being able to figure out why this is giving wrong answer

Can you please add comments to your code to explain them a little.

Try to understand my logic without comments…

Thanks I got it. My mistake was I was not clearing map for each test case.
m.clear() It works now

1 Like