/**
 * This function takes in a string and a character, and returns a list of all the indices
 * where the character occurs in the string using loops.
 *
 * @param string The string to search for the character.
 * @param character The character to find in the string.
 * @return A list containing the indices where the character occurs in the string.
 */
fun findCharacters(string: String, character: Char): List<Int> {

    val indices = mutableListOf<Int>() // List to store the indices of occurrences
    
    // Loop through each character in the string
    for (i in string.indices) {
        if (string[i] == character) { // Check if the character matches the target character
            indices.add(i) // Add the index to the list
        }
    }
    
    return indices
}
/**
 * This function takes in a string and a character, and returns a list of all the indices
 * where the character occurs in the string using loops.
 *
 * @param string The string to search for the character.
 * @param character The character to find in the string.
 * @return A list containing the indices where the character occurs in the string.
 */
fun findCharacters(string: String, character: Char): List<Int> {
/**
 * This function takes in a string and a character, and returns a list of all the indices
 * where the character occurs in the string using loops.
 *
 * @param string The string to search for the character.
 * @param character The character to find in the string.
 * @return A list containing the indices where the character occurs in the string.
 */
fun findCharacters(string: String, character: Char): List<Int> {

    val indices = mutableListOf<Int>() // List to store the indices of occurrences
    
    // Loop through each character in the string
    for (i in string.indices) {
        if (string[i] == character) { // Check if the character matches the target character
            indices.add(i) // Add the index to the list
        }
    }
    
    return indices
}