/**
 * Given a text and a word, the function finds the number of occurrences of the word in the text.
 *
 * @param text The input text string.
 * @param word The word to search for in the text.
 * @return The number of occurrences of the word in the text.
 */
fun findArtifact(text: String, word: String): Int {

    var count = 0
    var index = 0

    while (index != -1) {
        index = text.indexOf(word, index)
        if (index != -1) {
            count++
            index += word.length
        }
    }

    return count
}
/**
 * Given a text and a word, the function finds the number of occurrences of the word in the text.
 *
 * @param text The input text string.
 * @param word The word to search for in the text.
 * @return The number of occurrences of the word in the text.
 */
fun findArtifact(text: String, word: String): Int {
/**
 * Given a text and a word, the function finds the number of occurrences of the word in the text.
 *
 * @param text The input text string.
 * @param word The word to search for in the text.
 * @return The number of occurrences of the word in the text.
 */
fun findArtifact(text: String, word: String): Int {

    var count = 0
    var index = 0

    while (index != -1) {
        index = text.indexOf(word, index)
        if (index != -1) {
            count++
            index += word.length
        }
    }

    return count
}