Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9232a0f

Browse files
author
Victor
authored
simplified a little.
1 parent 9016315 commit 9232a0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎920. Number of Music Playlists.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ int numMusicPlaylists(int N, int L, int K){
6363
for (i = 1; i <= L; i ++) {
6464
for (j = 1; j <= N; j ++) {
6565
x = N - j + 1; // number of songs not being selected (including current song j)
66-
dp[IDX(i, j)] += dp[IDX(i - 1, j - 1)] * x; // choose a new song
66+
dp[IDX(i, j)] = dp[IDX(i - 1, j - 1)] * x; // choose a new song
6767

6868
x = j - K; // number of played songs (including song j) can be re-selected
6969
if (x > 0) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /