/**
 * Given a dictionary of archaeological sites and their artifacts,
 * compute the total count of artifacts across all sites.
 *
 * @param archaeologicalSites A dictionary mapping site names to a list of artifacts present at the site.
 *                            Each artifact is represented as a string.
 * @return The total count of artifacts across all sites.
 *
 * Example:
 * val archaeologicalSites = mapOf(
 *     "Site A" to listOf("Pottery", "Coins", "Bones"),
 *     "Site B" to listOf("Pottery", "Coins"),
 *     "Site C" to listOf("Coins", "Bones", "Clay Tablets"),
 *     "Site D" to listOf("Pottery")
 * )
 * val count = countArtifacts(archaeologicalSites)
 * println(count)  // Output: 9
 */
fun countArtifacts(archaeologicalSites: Map<String, List<String>>): Int {

    var totalCount = 0

    // Iterate over each site in the dictionary
    for ((_, artifacts) in archaeologicalSites) {
        // Iterate over each artifact in the site list
        for (artifact in artifacts) {
            // Increment the total count by 1 for each artifact found
            totalCount++
        }
    }

    return totalCount
}
/**
 * Given a dictionary of archaeological sites and their artifacts,
 * compute the total count of artifacts across all sites.
 *
 * @param archaeologicalSites A dictionary mapping site names to a list of artifacts present at the site.
 *                            Each artifact is represented as a string.
 * @return The total count of artifacts across all sites.
 *
 * Example:
 * val archaeologicalSites = mapOf(
 *     "Site A" to listOf("Pottery", "Coins", "Bones"),
 *     "Site B" to listOf("Pottery", "Coins"),
 *     "Site C" to listOf("Coins", "Bones", "Clay Tablets"),
 *     "Site D" to listOf("Pottery")
 * )
 * val count = countArtifacts(archaeologicalSites)
 * println(count)  // Output: 9
 */
fun countArtifacts(archaeologicalSites: Map<String, List<String>>): Int {
/**
 * Given a dictionary of archaeological sites and their artifacts,
 * compute the total count of artifacts across all sites.
 *
 * @param archaeologicalSites A dictionary mapping site names to a list of artifacts present at the site.
 *                            Each artifact is represented as a string.
 * @return The total count of artifacts across all sites.
 *
 * Example:
 * val archaeologicalSites = mapOf(
 *     "Site A" to listOf("Pottery", "Coins", "Bones"),
 *     "Site B" to listOf("Pottery", "Coins"),
 *     "Site C" to listOf("Coins", "Bones", "Clay Tablets"),
 *     "Site D" to listOf("Pottery")
 * )
 * val count = countArtifacts(archaeologicalSites)
 * println(count)  // Output: 9
 */
fun countArtifacts(archaeologicalSites: Map<String, List<String>>): Int {

    var totalCount = 0

    // Iterate over each site in the dictionary
    for ((_, artifacts) in archaeologicalSites) {
        // Iterate over each artifact in the site list
        for (artifact in artifacts) {
            // Increment the total count by 1 for each artifact found
            totalCount++
        }
    }

    return totalCount
}