/**
 * This function takes the name of an athlete and a target word, and returns the number
 * of occurrences of the target word in the athlete's name. The name is input as a string,
 * and the target word is input as a string as well. The function is case-sensitive, so
 * 'a' and 'A' are considered different characters.
 *
 * Example:
 * name = "Michael Jordan"
 * targetWord = "an"
 * Output: 0
 *
 * name = "Serena Williams"
 * targetWord = "li"
 * Output: 1
 *
 * name = "Usain Bolt"
 * targetWord = "Us"
 * Output: 1
 */
fun athleteWordCount(name: String, targetWord: String): Int {

    var count = 0
    var i = 0

    while (i < name.length) {
        if (name.substring(i, i + targetWord.length) == targetWord) {
            count++
        }
        i++
    }

    return count
}
/**
 * This function takes the name of an athlete and a target word, and returns the number
 * of occurrences of the target word in the athlete's name. The name is input as a string,
 * and the target word is input as a string as well. The function is case-sensitive, so
 * 'a' and 'A' are considered different characters.
 *
 * Example:
 * name = "Michael Jordan"
 * targetWord = "an"
 * Output: 0
 *
 * name = "Serena Williams"
 * targetWord = "li"
 * Output: 1
 *
 * name = "Usain Bolt"
 * targetWord = "Us"
 * Output: 1
 */
fun athleteWordCount(name: String, targetWord: String): Int {
/**
 * This function takes the name of an athlete and a target word, and returns the number
 * of occurrences of the target word in the athlete's name. The name is input as a string,
 * and the target word is input as a string as well. The function is case-sensitive, so
 * 'a' and 'A' are considered different characters.
 *
 * Example:
 * name = "Michael Jordan"
 * targetWord = "an"
 * Output: 0
 *
 * name = "Serena Williams"
 * targetWord = "li"
 * Output: 1
 *
 * name = "Usain Bolt"
 * targetWord = "Us"
 * Output: 1
 */
fun athleteWordCount(name: String, targetWord: String): Int {

    var count = 0
    var i = 0

    while (i < name.length) {
        if (name.substring(i, i + targetWord.length) == targetWord) {
            count++
        }
        i++
    }

    return count
}