/**
 * Given a string and a list of characters, this function returns a list of indices where all the characters of the given list are found in the string.
 *
 * @param string A string in which characters need to be found
 * @param characters A list of characters to find in the string
 * @return A list of indices where all the characters of the given list are found in the string
 *
 * Example:
 * findMatchingCharacters("hello world", listOf('o', 'l')) -> listOf(4, 7)
 */
fun findMatchingCharacters(string: String, characters: List<Char>): List<Int> {

    val matchingIndices = mutableListOf<Int>()
    for (i in string.indices) {
        if (string[i] == characters[0]) {
            var found = true
            for (j in 1 until characters.size) {
                if (i + j >= string.length || string[i + j] != characters[j]) {
                    found = false
                    break
                }
            }
            if (found) {
                matchingIndices.add(i)
            }
        }
    }
    return matchingIndices
}
/**
 * Given a string and a list of characters, this function returns a list of indices where all the characters of the given list are found in the string.
 *
 * @param string A string in which characters need to be found
 * @param characters A list of characters to find in the string
 * @return A list of indices where all the characters of the given list are found in the string
 *
 * Example:
 * findMatchingCharacters("hello world", listOf('o', 'l')) -> listOf(4, 7)
 */
fun findMatchingCharacters(string: String, characters: List<Char>): List<Int> {
/**
 * Given a string and a list of characters, this function returns a list of indices where all the characters of the given list are found in the string.
 *
 * @param string A string in which characters need to be found
 * @param characters A list of characters to find in the string
 * @return A list of indices where all the characters of the given list are found in the string
 *
 * Example:
 * findMatchingCharacters("hello world", listOf('o', 'l')) -> listOf(4, 7)
 */
fun findMatchingCharacters(string: String, characters: List<Char>): List<Int> {

    val matchingIndices = mutableListOf<Int>()
    for (i in string.indices) {
        if (string[i] == characters[0]) {
            var found = true
            for (j in 1 until characters.size) {
                if (i + j >= string.length || string[i + j] != characters[j]) {
                    found = false
                    break
                }
            }
            if (found) {
                matchingIndices.add(i)
            }
        }
    }
    return matchingIndices
}