Skip to content

Commit 9e3a1e2

Browse files
committed
Runtime: 499 ms (Top 76.47%) | Memory: 108.2 MB (Top 70.59%)
1 parent e90339f commit 9e3a1e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/algorithms/A/Arithmetic Slices II - Subsequence/Arithmetic Slices II - Subsequence.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 499 ms (Top 76.47%) | Memory: 108.2 MB (Top 70.59%)
12
/**
23
* @param {number[]} nums
34
* @return {number}
@@ -16,10 +17,10 @@ var numberOfArithmeticSlices = function(nums) {
1617
}
1718
let apsEndingAtI = dp[i].get(commonDifference) || 0
1819
let apsEndingAtJ = dp[j].get(commonDifference) || 0
19-
20+
2021
dp[j].set(commonDifference, (apsEndingAtI + apsEndingAtJ + 1));
2122
ans += apsEndingAtI;
2223
}
2324
}
2425
return ans;
25-
};
26+
};

0 commit comments

Comments
 (0)