/**
 * This function counts the number of occurrences of a word in a given sentence.
 */
fun countOccurrences(sentence: String, word: String): Int {

    var count = 0
    var index = 0
    while (index < sentence.length) {
        if (sentence.substring(index).startsWith(word)) {
            count++
            index += word.length - 1
        }
        index++
    }
    return count
}
/**
 * This function counts the number of occurrences of a word in a given sentence.
 */
fun countOccurrences(sentence: String, word: String): Int {
/**
 * This function counts the number of occurrences of a word in a given sentence.
 */
fun countOccurrences(sentence: String, word: String): Int {

    var count = 0
    var index = 0
    while (index < sentence.length) {
        if (sentence.substring(index).startsWith(word)) {
            count++
            index += word.length - 1
        }
        index++
    }
    return count
}