-
303. Range Sum Query - Immutable javaLeetCode_Study_Plan/Programming Skills 2022. 9. 25. 15:22
https://leetcode.com/problems/range-sum-query-immutable/?envType=study-plan&id=programming-skills-i
class NumArray { int[] nums; public NumArray(int[] nums) { this.nums = nums; } public int sumRange(int left, int right) { int sum = 0; for(int i = left; i <= right; i++){ sum += this.nums[i]; } return sum; } }
'LeetCode_Study_Plan > Programming Skills' 카테고리의 다른 글
[Programming Skills I] 종료 (2) 2022.09.25 1603. Design Parking System java (0) 2022.09.25 1356. Sort Integers by The Number of 1 Bits java (1) 2022.09.24 217. Contains Duplicate java (0) 2022.09.24 242. Valid Anagram java (0) 2022.09.24