/**
 * Given a dictionary of archeological sites containing nested dictionaries of artifacts, find the specific artifact with the highest value.
 *
 * @param archeologicalSites A dictionary representing archeological sites and their artifacts
 * @return A tuple containing the site ID, artifact category, and its value.
 */
fun findArtifact(archeologicalSites: Map<String, Map<String, Int>>): Triple<String, String, Int> {

    var highestValue = 0
    var artifactInfo = Triple("", "", 0)

    for ((siteId, artifacts) in archeologicalSites) {
        for ((category, value) in artifacts) {
            if (value > highestValue) {
                highestValue = value
                artifactInfo = Triple(siteId, category, value)
            }
        }
    }

    return artifactInfo
}

// Example usage:
val archeologicalSites = mapOf(
    "Site1" to mapOf(
        "Pottery" to 1000,
        "Coins" to 500,
        "Tools" to 800
    ),
    "Site2" to mapOf(
        "Pottery" to 1200,
        "Coins" to 700,
        "Tools" to 650
    ),
    "Site3" to mapOf(
        "Pottery" to 800,
        "Coins" to 900,
        "Tools" to 950
    )
)

val artifact = findArtifact(archeologicalSites)
/**
 * Given a dictionary of archeological sites containing nested dictionaries of artifacts, find the specific artifact with the highest value.
 *
 * @param archeologicalSites A dictionary representing archeological sites and their artifacts
 * @return A tuple containing the site ID, artifact category, and its value.
 */
fun findArtifact(archeologicalSites: Map<String, Map<String, Int>>): Triple<String, String, Int> {
/**
 * Given a dictionary of archeological sites containing nested dictionaries of artifacts, find the specific artifact with the highest value.
 *
 * @param archeologicalSites A dictionary representing archeological sites and their artifacts
 * @return A tuple containing the site ID, artifact category, and its value.
 */
fun findArtifact(archeologicalSites: Map<String, Map<String, Int>>): Triple<String, String, Int> {

    var highestValue = 0
    var artifactInfo = Triple("", "", 0)

    for ((siteId, artifacts) in archeologicalSites) {
        for ((category, value) in artifacts) {
            if (value > highestValue) {
                highestValue = value
                artifactInfo = Triple(siteId, category, value)
            }
        }
    }

    return artifactInfo
}

// Example usage:
val archeologicalSites = mapOf(
    "Site1" to mapOf(
        "Pottery" to 1000,
        "Coins" to 500,
        "Tools" to 800
    ),
    "Site2" to mapOf(
        "Pottery" to 1200,
        "Coins" to 700,
        "Tools" to 650
    ),
    "Site3" to mapOf(
        "Pottery" to 800,
        "Coins" to 900,
        "Tools" to 950
    )
)

val artifact = findArtifact(archeologicalSites)