/**
 * This function creates a playlist for a musician based on their albums.
 * It uses a map to store the albums as keys and assigns a random rating to each album.
 * The playlist is then generated by selecting the albums with the highest rating.
 *
 * @param musician The name of the musician.
 * @param albums A map where the keys are the album names and the values are the years of release.
 * @return A list of album names that make up the playlist.
 */
fun createPlaylist(musician: String, albums: Map<String, Int>): List<String> {

    val albumRatings = albums.mapValues { (_, _) -> (1..10).random() }
    val highestRating = albumRatings.values.maxOrNull()

    val playlist = albumRatings.filterValues { it == highestRating }.keys.toList()

    return playlist
}
/**
 * This function creates a playlist for a musician based on their albums.
 * It uses a map to store the albums as keys and assigns a random rating to each album.
 * The playlist is then generated by selecting the albums with the highest rating.
 *
 * @param musician The name of the musician.
 * @param albums A map where the keys are the album names and the values are the years of release.
 * @return A list of album names that make up the playlist.
 */
fun createPlaylist(musician: String, albums: Map<String, Int>): List<String> {
/**
 * This function creates a playlist for a musician based on their albums.
 * It uses a map to store the albums as keys and assigns a random rating to each album.
 * The playlist is then generated by selecting the albums with the highest rating.
 *
 * @param musician The name of the musician.
 * @param albums A map where the keys are the album names and the values are the years of release.
 * @return A list of album names that make up the playlist.
 */
fun createPlaylist(musician: String, albums: Map<String, Int>): List<String> {

    val albumRatings = albums.mapValues { (_, _) -> (1..10).random() }
    val highestRating = albumRatings.values.maxOrNull()

    val playlist = albumRatings.filterValues { it == highestRating }.keys.toList()

    return playlist
}