/**
 * This function filters the paintings of artists, returning a map containing only the artists who have created a specific artwork.
 *
 * @param artists A map where the keys are artists' names (strings) and the values are lists of artworks that each artist has created.
 * @param artwork The specific artwork to search for.
 * @return A map containing only the artists who have created the given artwork.
 */
fun filterPaintings(artists: Map<String, List<String>>, artwork: String): Map<String, List<String>> {

    val selectedArtists = mutableMapOf<String, List<String>>()

    // Iterate over each artist in the map
    for ((artist, paintings) in artists) {
        // Check if the artwork is in the artist's paintings
        if (artwork in paintings) {
            // Add the artist to the selectedArtists map
            selectedArtists[artist] = paintings
        }
    }

    return selectedArtists
}
/**
 * This function filters the paintings of artists, returning a map containing only the artists who have created a specific artwork.
 *
 * @param artists A map where the keys are artists' names (strings) and the values are lists of artworks that each artist has created.
 * @param artwork The specific artwork to search for.
 * @return A map containing only the artists who have created the given artwork.
 */
fun filterPaintings(artists: Map<String, List<String>>, artwork: String): Map<String, List<String>> {
/**
 * This function filters the paintings of artists, returning a map containing only the artists who have created a specific artwork.
 *
 * @param artists A map where the keys are artists' names (strings) and the values are lists of artworks that each artist has created.
 * @param artwork The specific artwork to search for.
 * @return A map containing only the artists who have created the given artwork.
 */
fun filterPaintings(artists: Map<String, List<String>>, artwork: String): Map<String, List<String>> {

    val selectedArtists = mutableMapOf<String, List<String>>()

    // Iterate over each artist in the map
    for ((artist, paintings) in artists) {
        // Check if the artwork is in the artist's paintings
        if (artwork in paintings) {
            // Add the artist to the selectedArtists map
            selectedArtists[artist] = paintings
        }
    }

    return selectedArtists
}