← 返回 netflix 的题目列表Music Playlist Implementation
类型:online_judge
Design a music playlist system that includes the following functionalities:
add(song_name): Add a song to the playlist.
remove(song_name): Remove a song from the playlist.
shuffle(): Randomly shuffle the song order in the playlist.
The functionalities should work correctly and the entire system should be testable on the spot.
Note: Ensure the system is bug-free and can pass live testing.
Hint: You may consider using List or other relevant data structures to implement the features above.
Example
Input
add SongA
add SongB
remove SongA
shuffle
Output
['SongB'] shuffled