Sir why is it show run-time error on one test case only in the code. Giving correct for all other test cases.
Alice and Bob : run error
@aman2382000 , I have made some changes to your code https://ide.codingblocks.com/s/184138
The test case had some really large numbers also I guess. I changed 1e5 to 2*1e5 and optimized the space complexity a bit (Since the numbers were large). I have optimized your code to 1-D DP. Feel free if you have any further questions.
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.
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.