Skip to main content

Practice · 1 of 3

Matrix Chain

CHALLENGE
Difficulty: advanced+25 XP

**Problem.** Line 1: n (number of matrices). Line 2: n+1 dimensions d[0..n]. Matrix i has shape d[i-1] x d[i]. Print the minimum number of scalar multiplications. **Constraints:** 1 ≤ n ≤ 300; 1 ≤ d[i] ≤ 10^5. The canonical interval DP: split points over growing lengths.

Back to lesson: Practice: Interval Trio