public int maxSubArray_lint(int[] nums) {
        if (nums == null || nums.length == 0)
            return 0;
        int[] dp = new int[nums.length];
        int localmax = 0;
        int global = Integer.MIN_VALUE;
        for (int i = 0; i < nums.length; ++i) {
            localmax = Math.max(nums[i], localmax + nums[i]);
            global = Math.max(localmax, global);
            dp[i] = global;
        }
        return dp[nums.length - 1];
    }