Please read the new rule regarding the restriction on the use of AI tools. ×

unable to solve this question, need help

Revision en1, by playinwithfire, 2023-10-15 19:25:08

You have two arrays A and B. They have the same length and values are from positive integers. For example:

A = [6, 3, 4, 8, 3] B = [2, 4, 2, 1, 2]

You need to find such two indexes i, j where i != j such that expression A[i] * B[i] + A[i] * B[j] + A[j] * B[j] is maximized. For example here it is i = 3, j = 1 which gives maximum of 52

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English playinwithfire 2023-10-15 19:25:08 382 Initial revision (published)