/**
 * This function takes in a word and a character and returns a list of indices where the character appears in the word using loops.
 */
fun findLetters(word: String, char: Char): List<Int> {

    val indices = mutableListOf<Int>()
    for ((index, letter) in word.withIndex()) {
        if (letter == char) {
            indices.add(index)
        }
    }
    return indices
}
/**
 * This function takes in a word and a character and returns a list of indices where the character appears in the word using loops.
 */
fun findLetters(word: String, char: Char): List<Int> {
/**
 * This function takes in a word and a character and returns a list of indices where the character appears in the word using loops.
 */
fun findLetters(word: String, char: Char): List<Int> {

    val indices = mutableListOf<Int>()
    for ((index, letter) in word.withIndex()) {
        if (letter == char) {
            indices.add(index)
        }
    }
    return indices
}