O 18. Analyzing Arrays You are given a 1-indexed array of integers that you are to analyze by raising each element to th
-
- Posts: 43759
- Joined: Sat Aug 07, 2021 7:38 am
O 18. Analyzing Arrays You are given a 1-indexed array of integers that you are to analyze by raising each element to th
O 18. Analyzing Arrays You are given a 1-indexed array of integers that you are to analyze by raising each element to the power of the next element, calculated modulo (10⁹+7) because these numbers may be very large. Then, find the smallest index at which this value is the greatest. Example arr = [3, 5, 4, 2] The values at the indexes are as follows: For arr[1] =3, calculate 39 (because 5 is the next element), which is 243. • For arri27 = 5) calculate 5* (because 4 is the next e ement), which is 625. For arr[3] = 4, calculate 42 (because 2 is the next element), which is 16.. For arr[4] = 2, no calculation is needed because there is no next 4 THE