given array A and number s, find i,j so sum of A[i..j] = s(adsbygoogle = window.adsbygoogle || []).push({});

Can this be done in linear time? I've thought of using a hashtable

but I would be interested in other methods.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Finding sequence that maps to a given sum

**Physics Forums | Science Articles, Homework Help, Discussion**