Tag: prefix sum
Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums = , …
Given an array nums and a target value k, find the maximum length of a Contiguous subarray that sums to k. If there isn’t one, return 0 instead. The …
Given an array of integers nums, write a method that returns the “pivot” index of this array. We define the pivot index as the index where the sum of …
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Given nums = sumRange(0, 2): 1 sumRange(2, 5): …