/**
 * This function takes a string and a character as input and returns a list 
 * of indices where the character is found in the string.
 * 
 * @param string The input string
 * @param char The character to search for
 * @return A list of indices where the character is found
 * 
 * Examples:
 * findSpecificCharacter("astronomer", 'o') -> [2, 3, 8]
 * findSpecificCharacter("astronomer", 'm') -> [6]
 */
fun findSpecificCharacter(string: String, char: Char): List<Int> {

    val indices = mutableListOf<Int>()  // Initialize an empty list to store the indices
    string.forEachIndexed { index, value ->
        if (value == char) {
            indices.add(index)
        }
    }
    return indices
}
/**
 * This function takes a string and a character as input and returns a list 
 * of indices where the character is found in the string.
 * 
 * @param string The input string
 * @param char The character to search for
 * @return A list of indices where the character is found
 * 
 * Examples:
 * findSpecificCharacter("astronomer", 'o') -> [2, 3, 8]
 * findSpecificCharacter("astronomer", 'm') -> [6]
 */
fun findSpecificCharacter(string: String, char: Char): List<Int> {
/**
 * This function takes a string and a character as input and returns a list 
 * of indices where the character is found in the string.
 * 
 * @param string The input string
 * @param char The character to search for
 * @return A list of indices where the character is found
 * 
 * Examples:
 * findSpecificCharacter("astronomer", 'o') -> [2, 3, 8]
 * findSpecificCharacter("astronomer", 'm') -> [6]
 */
fun findSpecificCharacter(string: String, char: Char): List<Int> {

    val indices = mutableListOf<Int>()  // Initialize an empty list to store the indices
    string.forEachIndexed { index, value ->
        if (value == char) {
            indices.add(index)
        }
    }
    return indices
}