Amazon | OA | SDE 2 | Please help solve: sum of 'powers' of contiguous subarrays?
Anonymous User
321

I'm not sure how to translate the equation into code. Please help if you can, thank you!

Input: list of ints
Output: sum of 'powers' of contiguous subarrays modded by a constant value as an int

powers is defined as:
image

eg input: : [2, 3, 2, 1]
output: 69

Comments (1)