/**
 * Given a list of ancient texts, find the occurrences of a specific word in each text.
 *
 * @param ancientTexts A list of strings representing ancient texts.
 * @return A list of tuples containing the index of the text and the occurrences of the specified word.
 */
fun anthropologistReport(ancientTexts: List<String>): List<Pair<Int, Int>> {

    val word = "artifact" // Specify the word to search
    val results = mutableListOf<Pair<Int, Int>>() // Store the results

    for ((index, text) in ancientTexts.withIndex()) { // Loop through the ancient texts
        var count = 0 // Initialize count to 0 for each text
        val words = text.split(" ") // Split the text into individual words

        for (w in words) { // Loop through each word in the text
            if (w == word) { // Check if the word matches the specified word
                count++ // Increment count if there is a match
            }
        }

        results.add(index to count) // Add the index and count as a pair to the results list
    }

    return results // Return the list of pairs
}
/**
 * Given a list of ancient texts, find the occurrences of a specific word in each text.
 *
 * @param ancientTexts A list of strings representing ancient texts.
 * @return A list of tuples containing the index of the text and the occurrences of the specified word.
 */
fun anthropologistReport(ancientTexts: List<String>): List<Pair<Int, Int>> {
/**
 * Given a list of ancient texts, find the occurrences of a specific word in each text.
 *
 * @param ancientTexts A list of strings representing ancient texts.
 * @return A list of tuples containing the index of the text and the occurrences of the specified word.
 */
fun anthropologistReport(ancientTexts: List<String>): List<Pair<Int, Int>> {

    val word = "artifact" // Specify the word to search
    val results = mutableListOf<Pair<Int, Int>>() // Store the results

    for ((index, text) in ancientTexts.withIndex()) { // Loop through the ancient texts
        var count = 0 // Initialize count to 0 for each text
        val words = text.split(" ") // Split the text into individual words

        for (w in words) { // Loop through each word in the text
            if (w == word) { // Check if the word matches the specified word
                count++ // Increment count if there is a match
            }
        }

        results.add(index to count) // Add the index and count as a pair to the results list
    }

    return results // Return the list of pairs
}