/**
 * Given two lists of dancers, find the common elements between them and return a set.
 *
 * @param dancers1 List of dancers from the first group
 * @param dancers2 List of dancers from the second group
 * @return Set of common dancers
 *
 * Example:
 * findCommonElements(listOf("John", "Sarah", "Mike"), listOf("Mike", "Emily", "John")) -> setOf("John", "Mike")
 */
fun findCommonElements(dancers1: List<String>, dancers2: List<String>): Set<String> {

    val commonDancers = mutableSetOf<String>()

    // Iterate through each dancer in dancers1
    for (dancer in dancers1) {
        // Check if the dancer is in dancers2
        if (dancer in dancers2) {
            // Add the dancer to the commonDancers set
            commonDancers.add(dancer)
        }
    }

    return commonDancers
}
/**
 * Given two lists of dancers, find the common elements between them and return a set.
 *
 * @param dancers1 List of dancers from the first group
 * @param dancers2 List of dancers from the second group
 * @return Set of common dancers
 *
 * Example:
 * findCommonElements(listOf("John", "Sarah", "Mike"), listOf("Mike", "Emily", "John")) -> setOf("John", "Mike")
 */
fun findCommonElements(dancers1: List<String>, dancers2: List<String>): Set<String> {
/**
 * Given two lists of dancers, find the common elements between them and return a set.
 *
 * @param dancers1 List of dancers from the first group
 * @param dancers2 List of dancers from the second group
 * @return Set of common dancers
 *
 * Example:
 * findCommonElements(listOf("John", "Sarah", "Mike"), listOf("Mike", "Emily", "John")) -> setOf("John", "Mike")
 */
fun findCommonElements(dancers1: List<String>, dancers2: List<String>): Set<String> {

    val commonDancers = mutableSetOf<String>()

    // Iterate through each dancer in dancers1
    for (dancer in dancers1) {
        // Check if the dancer is in dancers2
        if (dancer in dancers2) {
            // Add the dancer to the commonDancers set
            commonDancers.add(dancer)
        }
    }

    return commonDancers
}