#3290

Maximum Multiplication Score

expert · 1000 · lc medium +32 · 41.3% accepted · 189 likes · top 22%

Description

You are given size-4 integer array a and integer array b (length >= 4). Choose indices i0 < i1 < i2 < i3 from b to maximize a[0]*b[i0] + a[1]*b[i1] + a[2]*b[i2] + a[3]*b[i3]. Return the maximum score.

Code

1
2
3