Skip to content

Commit 52ecad7

Browse files
authoredOct 20, 2020
Update 1621-number-of-sets-of-k-non-overlapping-line-segments.js
1 parent 669e872 commit 52ecad7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎1621-number-of-sets-of-k-non-overlapping-line-segments.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ const numberOfSets = function (n, k) {
2828
const MOD = 10 ** 9 + 7
2929
dp[1][1] = 1
3030
for (let i = 2; i < n; i++) dp[i][1] = ((i + 1) * i) / 2
31+
// sum[i][j] as: the number of ways to generate
32+
// j - 1 segments from i - 1 points.
3133
const sum = Array.from({ length: n }, () => Array(k + 1).fill(0))
3234
for (let i = 2; i < n; i++) {
3335
for (let j = 2; j <= k; j++) {

0 commit comments

Comments
 (0)
Please sign in to comment.