Skip to content

Commit 8d357cc

Browse files
authored
Update 560-subarray-sum-equals-k.js
1 parent bcede51 commit 8d357cc

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

560-subarray-sum-equals-k.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ const subarraySum = function(nums, k) {
3232
const subarraySum = function (nums, k) {
3333
const n = nums.length, hash = { 0: 1 }
3434
let pre = 0
35-
if (nums.length === 1) {
36-
return nums[0] === k ? 1 : 0
37-
}
3835
let res = 0
3936
for (let i = 0; i < n; i++) {
4037
const cur = pre + nums[i]

0 commit comments

Comments
 (0)