Nuacht
The problem is solved using Kadane's Algorithm. You will declare two variables sum and maxi. If sum less than 0, you just make sum as 0 because adding negatives anyway reduce or hamper the total sum ...
The current test cases do not handle scenarios where multiple duplicate elements exist but the optimal unique subarray is formed by deleting more than one of them — especially when they are not ...
Cuireadh roinnt torthaí i bhfolach toisc go bhféadfadh siad a bheith dorochtana duit
Taispeáin torthaí dorochtana