leetcode走故乡算法通用算法的学习问题及项目公共类解决方案{ public int lgt(int[] nums){ int n = nums.length; int[] dp =新的int[n]; dp[0] = nums[0]; for (int i=1;i0) dp[i] = dp[i-1]+nums[i];否则dp[i] = nums[i]; } int max = Integer.MIN_VALUE; for (int i=0;i