Tap here to switch tabs
Problem
Submissions

Problem: Number of Music Playlists

med
30 min
Try to solve the Number of Music Playlists problem.

Statement

You have n different songs and want to create a playlist of length goal.

A playlist is considered valid if:

  • Every song is played at least 11 time.

  • A song can only be played again if at least k other songs have been played after its previous occurrence.

Given n, goal, and k, return the total number of possible playlists. Since the answer can be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 0≤0 \leq k << n ≤\leq goal ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Music Playlists

med
30 min
Try to solve the Number of Music Playlists problem.

Statement

You have n different songs and want to create a playlist of length goal.

A playlist is considered valid if:

  • Every song is played at least 11 time.

  • A song can only be played again if at least k other songs have been played after its previous occurrence.

Given n, goal, and k, return the total number of possible playlists. Since the answer can be very large, return it modulo 109+710^9 + 7.

Constraints:

  • 0≤0 \leq k << n ≤\leq goal ≤100\leq 100