sum query july cookoff

why am i getting a runtime error ??

problem page:-

my solution:-

N <= 10^9 . You can’t have an array of that size.

do you really think array[10^9] will work?

because n can be 10^9 atmost

try to solve problem another way…hint:mathematically :smiley:


thnx man for pointing it to mathematicis :slight_smile: