/**
 * Given a string and a character, find all the indices where the character is missing.
 *
 * @param string The input string.
 * @param char The character to find.
 * @return A list of indices where the character is missing.
 *
 * Example:
 * string = "Hello, world!"
 * char = "o"
 * findMissingIndices(string, char) // [1, 4, 8]
 *
 * Note:
 * The indices are 0-based, so the first character is at index 0.
 *
 * Your task is to implement the 'findMissingIndices' function to find all the indices where the character is missing in the given string.
 * You should use loops to iterate through the string and check each character if it matches the specified character or not.
 * If it doesn't match, add the index of that character to a list.
 * Finally, return the list of missing indices.
 */
fun findMissingIndices(string: String, char: Char): List<Int> {

    val missingIndices = mutableListOf<Int>()
    for (i in string.indices) {
        if (string[i] != char) {
            missingIndices.add(i)
        }
    }
    return missingIndices
}
/**
 * Given a string and a character, find all the indices where the character is missing.
 *
 * @param string The input string.
 * @param char The character to find.
 * @return A list of indices where the character is missing.
 *
 * Example:
 * string = "Hello, world!"
 * char = "o"
 * findMissingIndices(string, char) // [1, 4, 8]
 *
 * Note:
 * The indices are 0-based, so the first character is at index 0.
 *
 * Your task is to implement the 'findMissingIndices' function to find all the indices where the character is missing in the given string.
 * You should use loops to iterate through the string and check each character if it matches the specified character or not.
 * If it doesn't match, add the index of that character to a list.
 * Finally, return the list of missing indices.
 */
fun findMissingIndices(string: String, char: Char): List<Int> {
/**
 * Given a string and a character, find all the indices where the character is missing.
 *
 * @param string The input string.
 * @param char The character to find.
 * @return A list of indices where the character is missing.
 *
 * Example:
 * string = "Hello, world!"
 * char = "o"
 * findMissingIndices(string, char) // [1, 4, 8]
 *
 * Note:
 * The indices are 0-based, so the first character is at index 0.
 *
 * Your task is to implement the 'findMissingIndices' function to find all the indices where the character is missing in the given string.
 * You should use loops to iterate through the string and check each character if it matches the specified character or not.
 * If it doesn't match, add the index of that character to a list.
 * Finally, return the list of missing indices.
 */
fun findMissingIndices(string: String, char: Char): List<Int> {

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