/**
 * Given the sets of paintings available to two artists, determine the paintings that are present in both sets.
 *
 * @param paintings1 Set of paintings available to the first artist.
 * @param paintings2 Set of paintings available to the second artist.
 * @return A set containing the paintings present in both artists' sets.
 *
 * Example:
 * artistPaintings(setOf("Mona Lisa", "Starry Night", "The Scream"), setOf("The Persistence of Memory", "The Starry Night", "The Last Supper"))
 * Output: setOf("The Starry Night")
 */
fun artistPaintings(paintings1: Set<String>, paintings2: Set<String>): Set<String> {

    // Initialize an empty set to store common paintings
    val commonPaintings = mutableSetOf<String>()

    // Iterate over paintings in paintings1 set
    for (painting in paintings1) {
        // Check if the painting is also present in paintings2 set
        if (painting in paintings2) {
            // Add the painting to the commonPaintings set
            commonPaintings.add(painting)
        }
    }

    // Return the set of common paintings
    return commonPaintings
}
/**
 * Given the sets of paintings available to two artists, determine the paintings that are present in both sets.
 *
 * @param paintings1 Set of paintings available to the first artist.
 * @param paintings2 Set of paintings available to the second artist.
 * @return A set containing the paintings present in both artists' sets.
 *
 * Example:
 * artistPaintings(setOf("Mona Lisa", "Starry Night", "The Scream"), setOf("The Persistence of Memory", "The Starry Night", "The Last Supper"))
 * Output: setOf("The Starry Night")
 */
fun artistPaintings(paintings1: Set<String>, paintings2: Set<String>): Set<String> {
/**
 * Given the sets of paintings available to two artists, determine the paintings that are present in both sets.
 *
 * @param paintings1 Set of paintings available to the first artist.
 * @param paintings2 Set of paintings available to the second artist.
 * @return A set containing the paintings present in both artists' sets.
 *
 * Example:
 * artistPaintings(setOf("Mona Lisa", "Starry Night", "The Scream"), setOf("The Persistence of Memory", "The Starry Night", "The Last Supper"))
 * Output: setOf("The Starry Night")
 */
fun artistPaintings(paintings1: Set<String>, paintings2: Set<String>): Set<String> {

    // Initialize an empty set to store common paintings
    val commonPaintings = mutableSetOf<String>()

    // Iterate over paintings in paintings1 set
    for (painting in paintings1) {
        // Check if the painting is also present in paintings2 set
        if (painting in paintings2) {
            // Add the painting to the commonPaintings set
            commonPaintings.add(painting)
        }
    }

    // Return the set of common paintings
    return commonPaintings
}