Regarding kedane's Algorithm

If we put all numbers in the array to be negative.Then sum should be negative but it shows positive.How it can be possible.

Hi Raushan, it will never show a positive number but the largest number no. in array. For ex in an array

a = {-1,-5,-3,-2}
// Output will be:
-1

If you have doubt in certain code then please saveit here and then share the link on this thread.

Hope this helps :slight_smile:

Hey Raushan, as you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.