I used the logic from the editorial. Still am getting WA. Can you please check?
WA even after using correct logic from editorial
hello @girishgargcool i have made two replacements in your code .
please try now.
if you still have any doubt please write here .
Happy Learning !!
Harm in keeping sum as global variable?
@girishgargcool yes there could be that is the reason why your code was not able to pass the test case.
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.