/**
 * Returns a list of works by the specified artist that are present in the given art collection.
 *
 * @param artist Name of the artist.
 * @param artCollection List of maps where each map represents an artwork with 'artist' as one of the keys.
 * @return List of works by the specified artist present in the art collection.
 */
fun findArtistWorks(artist: String, artCollection: List<Map<String, String>>): List<String> {

    val artistWorks = mutableListOf<String>()  // Empty list to store the works by the specified artist

    for (artwork in artCollection) {
        if (artwork["artist"]?.lowercase() == artist.lowercase()) {
            artistWorks.add(artwork["title"]!!)
        }
    }

    return artistWorks
}

// Example usage:
val collection = listOf(
    mapOf("artist" to "Leonardo da Vinci", "title" to "Mona Lisa"),
    mapOf("artist" to "Pablo Picasso", "title" to "Guernica"),
    mapOf("artist" to "Leonardo da Vinci", "title" to "The Last Supper"),
    mapOf("artist" to "Vincent van Gogh", "title" to "Starry Night"),
    mapOf("artist" to "Pablo Picasso", "title" to "Les Demoiselles d'Avignon")
)

// Find
/**
 * Returns a list of works by the specified artist that are present in the given art collection.
 *
 * @param artist Name of the artist.
 * @param artCollection List of maps where each map represents an artwork with 'artist' as one of the keys.
 * @return List of works by the specified artist present in the art collection.
 */
fun findArtistWorks(artist: String, artCollection: List<Map<String, String>>): List<String> {
/**
 * Returns a list of works by the specified artist that are present in the given art collection.
 *
 * @param artist Name of the artist.
 * @param artCollection List of maps where each map represents an artwork with 'artist' as one of the keys.
 * @return List of works by the specified artist present in the art collection.
 */
fun findArtistWorks(artist: String, artCollection: List<Map<String, String>>): List<String> {

    val artistWorks = mutableListOf<String>()  // Empty list to store the works by the specified artist

    for (artwork in artCollection) {
        if (artwork["artist"]?.lowercase() == artist.lowercase()) {
            artistWorks.add(artwork["title"]!!)
        }
    }

    return artistWorks
}

// Example usage:
val collection = listOf(
    mapOf("artist" to "Leonardo da Vinci", "title" to "Mona Lisa"),
    mapOf("artist" to "Pablo Picasso", "title" to "Guernica"),
    mapOf("artist" to "Leonardo da Vinci", "title" to "The Last Supper"),
    mapOf("artist" to "Vincent van Gogh", "title" to "Starry Night"),
    mapOf("artist" to "Pablo Picasso", "title" to "Les Demoiselles d'Avignon")
)

// Find