C# linq one line


  • 0
    F
    return nums.Skip(1).Aggregate(new{c=nums[0],b=nums[0]},(p,n)=>new{c=Math.Max(p.c+n,n),b=Math.Max(p.b,Math.Max(p.c+n,n))}).b;
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.