example 1770. Maximum Score from Performing Multiplication Operations

in case of top down approach one line is written "but we need to iterate backwards starting from m (because the base case happens when i == m)." Can anyone explain a bit more about it.

            for (int left = i; left >= 0; left--) {
                int mult = multipliers[i];
                int right = n - 1 - (i - left);
                dp[i][left] = Math.max(mult * nums[left] + dp[i + 1][left + 1], 
                                       mult * nums[right] + dp[i + 1][left]);
            }
        }
Comments (2)