Please Help me solve this (Amazon OA)

Revision en5, by I_Hate_Physics, 2022-10-15 11:01:18

For any array of positive integers a[a[1]..a[k]], its score(a) is calculated as follows: • For each a[i] where 1 ≤i≤k in order, add the current maximum element in the array to a[i]. • score(a[k]) is the sum of the final elements in a. Since the sums may become large, score(a) should be calculated modulo (10^9+7).

Question link(Google Drive Link

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English I_Hate_Physics 2022-10-15 11:01:18 12
en4 English I_Hate_Physics 2022-10-15 10:55:26 18 Tiny change: 'stion link](https' -> 'stion link(Google Drive Link](https'
en3 English I_Hate_Physics 2022-10-15 10:54:59 92
en2 English I_Hate_Physics 2022-10-15 10:53:36 16
en1 English I_Hate_Physics 2022-10-15 10:51:50 431 Initial revision (published)