1714. Sum Of Special Evenly-Spaced Elements In Array
Description
**Input:** nums = [0,1,2,3,4,5,6,7], queries = [[0,3],[5,1],[4,2]]
**Output:** [9,18,10]
**Explanation:** The answers of the queries are as follows:
1) The j indices that satisfy this query are 0, 3, and 6. nums[0] + nums[3] + nums[6] = 9
2) The j indices that satisfy this query are 5, 6, and 7. nums[5] + nums[6] + nums[7] = 18
3) The j indices that satisfy this query are 4 and 6. nums[4] + nums[6] = 10**Input:** nums = [100,200,101,201,102,202,103,203], queries = [[0,7]]
**Output:** [303]ac
Last updated