Sum of Elements using Indices | Service Now | SSE | Feb 2024 | DSA | Reject
Anonymous User
327

Given an array of n integers and q queries of the format s and e. Return the sum of elements of the indices from s to e.

a=[1,2,3,6,3,2];
q = 3
s,e-> [2,3]
s,e-> [0,4]
s,e-> [1,2]
sum=[9,12,5]

Comments (3)