Doubt regarding one case

the code i’ve written returns 0 in case all the elements are -ve but ideally it should return the max sum that is the -ve number with minimum magnitude.
i can handle this case using a for loop and if statement but my code has passed all test case :slight_smile:

hello @laksh.rustagi12

yeah handel that case explicitly

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.