Skip to content

Commit fe3c343

Browse files
refactor 303
1 parent 29f1f00 commit fe3c343

File tree

1 file changed

+7
-3
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+7
-3
lines changed

src/main/java/com/fishercoder/solutions/_303.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
package com.fishercoder.solutions;
22

3-
/**Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.
3+
/**
4+
* 303. Range Sum Query - Immutable
5+
* Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.
46
57
Example:
68
Given nums = [-2, 0, 3, -5, 2, -1]
79
810
sumRange(0, 2) -> 1
911
sumRange(2, 5) -> -1
1012
sumRange(0, 5) -> -3
13+
1114
Note:
1215
You may assume that the array does not change.
13-
There are many calls to sumRange function.*/
16+
There are many calls to sumRange function.
17+
*/
1418
public class _303 {
15-
class NumArray {
19+
public static class NumArray {
1620
int[] sums;
1721

1822
public NumArray(int[] nums) {

0 commit comments

Comments
 (0)