/**
 * Given a string and a character, return a list of indices at which the character occurs in the string.
 *
 * @param string The input string.
 * @param char The character to find in the input string.
 * @return A list of indices at which the character occurs in the string.
 *
 * Example:
 * findCharacters("astronomer", "o") returns [1, 7]
 */
fun findCharacters(string: String, char: Char): List<Int> {

    val indices = mutableListOf<Int>()
    for (i in string.indices) {
        if (string[i] == char) {
            indices.add(i)
        }
    }
    return indices
}
/**
 * Given a string and a character, return a list of indices at which the character occurs in the string.
 *
 * @param string The input string.
 * @param char The character to find in the input string.
 * @return A list of indices at which the character occurs in the string.
 *
 * Example:
 * findCharacters("astronomer", "o") returns [1, 7]
 */
fun findCharacters(string: String, char: Char): List<Int> {
/**
 * Given a string and a character, return a list of indices at which the character occurs in the string.
 *
 * @param string The input string.
 * @param char The character to find in the input string.
 * @return A list of indices at which the character occurs in the string.
 *
 * Example:
 * findCharacters("astronomer", "o") returns [1, 7]
 */
fun findCharacters(string: String, char: Char): List<Int> {

    val indices = mutableListOf<Int>()
    for (i in string.indices) {
        if (string[i] == char) {
            indices.add(i)
        }
    }
    return indices
}