/**
 * Given a list of relics found in different locations, use list comprehension and conditional statements
 * to find the relics that are common to all the locations.
 *
 * @param location A list of locations where relics were found
 * @param relicsFound A list of relics found at each location
 * @return A list of relics that are common to all the locations
 */
fun findRelics(location: List<String>, relicsFound: List<List<String>>): List<String> {

    // Check if 'relicsFound" is not empty
    if (relicsFound.isEmpty()) {
        println("No relics were found.")
        return emptyList()
    }

    // Create a set for the first set of relics
    var commonRelics = relicsFound[0].toSet()

    // Loop through the remaining locations
    for (i in 1 until relicsFound.size) {
        // Update 'commonRelics" with the intersection of 'commonRelics" and the i-th set of relics
        commonRelics = commonRelics.intersect(relicsFound[i].toSet())
    }

    // Convert the set of common relics back to a list
    return commonRelics.toList()
}
/**
 * Given a list of relics found in different locations, use list comprehension and conditional statements
 * to find the relics that are common to all the locations.
 *
 * @param location A list of locations where relics were found
 * @param relicsFound A list of relics found at each location
 * @return A list of relics that are common to all the locations
 */
fun findRelics(location: List<String>, relicsFound: List<List<String>>): List<String> {
/**
 * Given a list of relics found in different locations, use list comprehension and conditional statements
 * to find the relics that are common to all the locations.
 *
 * @param location A list of locations where relics were found
 * @param relicsFound A list of relics found at each location
 * @return A list of relics that are common to all the locations
 */
fun findRelics(location: List<String>, relicsFound: List<List<String>>): List<String> {

    // Check if 'relicsFound" is not empty
    if (relicsFound.isEmpty()) {
        println("No relics were found.")
        return emptyList()
    }

    // Create a set for the first set of relics
    var commonRelics = relicsFound[0].toSet()

    // Loop through the remaining locations
    for (i in 1 until relicsFound.size) {
        // Update 'commonRelics" with the intersection of 'commonRelics" and the i-th set of relics
        commonRelics = commonRelics.intersect(relicsFound[i].toSet())
    }

    // Convert the set of common relics back to a list
    return commonRelics.toList()
}