/**
 * This function counts the occurrences of a specific letter in each word in the given list.
 *
 * @param words a list of words
 * @param letter a letter to count occurrences for
 * @return a list of pairs (word, occurrences)
 */
fun countOccurrences(words: List<String>, letter: Char): List<Pair<String, Int>> {

    val result = mutableListOf<Pair<String, Int>>()
    for (word in words) {
        var count = 0
        for (char in word) {
            if (char == letter) {
                count++
            }
        }
        result.add(Pair(word, count))
    }
    return result
}
/**
 * This function counts the occurrences of a specific letter in each word in the given list.
 *
 * @param words a list of words
 * @param letter a letter to count occurrences for
 * @return a list of pairs (word, occurrences)
 */
fun countOccurrences(words: List<String>, letter: Char): List<Pair<String, Int>> {
/**
 * This function counts the occurrences of a specific letter in each word in the given list.
 *
 * @param words a list of words
 * @param letter a letter to count occurrences for
 * @return a list of pairs (word, occurrences)
 */
fun countOccurrences(words: List<String>, letter: Char): List<Pair<String, Int>> {

    val result = mutableListOf<Pair<String, Int>>()
    for (word in words) {
        var count = 0
        for (char in word) {
            if (char == letter) {
                count++
            }
        }
        result.add(Pair(word, count))
    }
    return result
}