303. Range Sum Query - Immutable
# Easy
Two methods:
Brute Force
Cache: while implementing
init()
, compute the sum of[0:i]
by the way,sumRange[i, j] = sum[j+1]-sum[i]
Last updated
# Easy
Two methods:
Brute Force
Cache: while implementing init()
, compute the sum of [0:i]
by the way, sumRange[i, j] = sum[j+1]-sum[i]
Last updated