Given a sequence of matrix dimensions, determine the minimum number of scalar multiplications needed to multiply the entire chain using simple recursion.
{
"dims": [
40,
20,
30,
10,
30
],
"i": 1,
"j": 4
}26000{
"dims": [
10,
30,
5,
60
],
"i": 1,
"j": 3
}4500{
"dims": [
10,
20,
30,
40,
30
],
"i": 1,
"j": 4
}30000Sign in to Run Code and Submit