Define minial pairs product sum?
Answers
Answered by
5
Answer:
Write a function that receives an array of integers and returns the minimal sum of the array (sum of products of each two adjacent numbers).
For Example:
Without sorting the array [40,25,10,5,1], the sum is:
(40*25) + (25*10) + (10*5) + (5*1) = 1305
Answered by
1
Write a function that receives an array of integers and returns the minimal sum of the array (sum of products of each two adjacent numbers).
For Example:
Without sorting the array [40,25,10,7,2] the sum is:
(40*25) + (25*10) + (10*7) + (7*2) = 1334
Similar questions
Economy,
6 months ago
Science,
11 months ago
Computer Science,
11 months ago
History,
1 year ago
Math,
1 year ago