码迷,mamicode.com
首页 > 其他好文 > 详细

307. Range Sum Query - Mutable

时间:2018-11-06 11:04:06      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:ice   tin   UNC   sum   bsp   clu   nbsp   find   class   


Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.

The update(i, val) function modifies nums by updating the element at index i to val.

Example:

Given nums = [1, 3, 5]

sumRange(0, 2) -> 9
update(1, 2)
sumRange(0, 2) -> 8

 

307. Range Sum Query - Mutable

标签:ice   tin   UNC   sum   bsp   clu   nbsp   find   class   

原文地址:https://www.cnblogs.com/tobeabetterpig/p/9913063.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!