Question: The maximum sum possible is 7 , and 7 modulo (109+7)=7. Function Description Complete the function gerMaxSumo/Array in the editor below. getMax5um OfArray has the

 The maximum sum possible is 7 , and 7 modulo (109+7)=7.

The maximum sum possible is 7 , and 7 modulo (109+7)=7. Function Description Complete the function gerMaxSumo/Array in the editor below. getMax5um OfArray has the following parameter(s): arri[n]: an array of integers arr2[n]; an array of integers Return int the maximum possible sum, modulo (109+7). Constraints - 1n105 - is arrifisiog - is arraidsio - Input Format For Custom Testing - Sample Case 0 Sample Input For Custom Testing STDIN FUNCTION -arri[]sizen=3arr1=[1,2,3]arr2[]sizen=3arr2=[1,10,10] Sample Output 5e Explanation Given n=3,arrf=[1,2,3] and arrz =[10,10,10]. Calculating arr 3 using i * (arr 2[1]arr1[D],arr3=[9,36,21] and its sum will be 47 . If arr 1 is changed to [3,2,1] and arr 2 remains unchanged ie. [10,10,10]. Now the value of i * (arr2[i] arri[i] =[7,16,27], and its sum is 50. In this case, 50 is the maximum sum

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!