Question: 1 . Question 1 Consider a 1 - based array of n integers, arr [ n ] . For each element arr [ i ]

1. Question 1 Consider a 1-based array of n integers, arr[n]. For each element arr[i] where 1<= i < n determine the value of arr[i]arr[i+1] modulo (10^9+7) Return the lowest index of the highest modulo value. Example arr =[3,5,4,5,2,10] index i arr[i]arr[i+1] modulo (109+7) result 13^5 modulo (10^9+7)2435^4 modulo (10^9+7)62524^5 modulo (10^9+7)102435^2 modulo (10^9+7)2542^10 modulo (10^9+7)10245 The greatest of these values is 1024 occurring at indices 3 and 5. Return the smaller index, 3. Function Description Complete the function powerArray in the editor.

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!