Here is my code.
Please help me to find the error.
Two test cases failing
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.
Full score solution was as a result of discussion on discuss but i still do want to know what is the issue in this code.
Hey @S18ML0001
Your logic is incorrect
You are trying to solve this problem greedily but this is a problem and your logic will fail
Please see this for explanation and solution https://ide.codingblocks.com/s/224331
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.