首页 > 其他分享> > LeetCode53最大子序和(dp思维) LeetCode53最大子序和(dp思维) 2021-01-17 21:30:22 作者:互联网 public int maxSubArray(int[] nums) { int res = Integer.MIN_VALUE; int dp=0; for (int i = 0; i < nums.length; i++) { dp=Math.max(dp+nums[i],nums[i]); if (dp>res) res=dp; } return res; } 标签:return,nums,int,res,LeetCode53,子序,dp 来源: https://blog.csdn.net/qq_43434328/article/details/112758013