public int maxProduct_naive(int[] nums) {
        if (nums.length == 0)
            return 0;
        if (nums.length == 1)
            return nums[0];
        // dp[i][j] = product of i to j
        int[][] dp = new int[nums.length][nums.length];
        int max = 0;
        for (int i = 0; i < nums.length; ++i) {
            for (int j = i; j < nums.length; ++j) {
                dp[i][j] = nums[i] * nums[j];
                max = Math.max(max, dp[i][j]);
            }
        }
        return max;
    }