/**
 * The function takes a list of patterns and a word as input and returns all the characters in the word that are not present
 * in any of the patterns. The function utilizes short-circuiting with if-else statements and the 'not in' operator.
 *
 * @param patterns A list of string patterns.
 * @param word A string containing the word to analyze.
 * @return A set of characters that are not present in any of the patterns.
 *
 * Example:
 * findUnknownCharacters(listOf("fox", "dog", "cat"), "elephant") -> setOf('e', 'l', 'p', 'h', 'a', 'n', 't')
 * findUnknownCharacters(listOf("apple", "banana", "cherry"), "pineapple") -> setOf('p', 'i', 'n')
 *
 * Difficulty: ★★★★★
 */
fun findUnknownCharacters(patterns: List<String>, word: String): Set<Char> {

    val unknownCharacters = mutableSetOf<Char>()

    for (char in word) {
        if (patterns.all { pattern -> char !in pattern }) {
            unknownCharacters.add(char)
        }
    }

    return unknownCharacters
}
/**
 * The function takes a list of patterns and a word as input and returns all the characters in the word that are not present
 * in any of the patterns. The function utilizes short-circuiting with if-else statements and the 'not in' operator.
 *
 * @param patterns A list of string patterns.
 * @param word A string containing the word to analyze.
 * @return A set of characters that are not present in any of the patterns.
 *
 * Example:
 * findUnknownCharacters(listOf("fox", "dog", "cat"), "elephant") -> setOf('e', 'l', 'p', 'h', 'a', 'n', 't')
 * findUnknownCharacters(listOf("apple", "banana", "cherry"), "pineapple") -> setOf('p', 'i', 'n')
 *
 * Difficulty: ★★★★★
 */
fun findUnknownCharacters(patterns: List<String>, word: String): Set<Char> {
/**
 * The function takes a list of patterns and a word as input and returns all the characters in the word that are not present
 * in any of the patterns. The function utilizes short-circuiting with if-else statements and the 'not in' operator.
 *
 * @param patterns A list of string patterns.
 * @param word A string containing the word to analyze.
 * @return A set of characters that are not present in any of the patterns.
 *
 * Example:
 * findUnknownCharacters(listOf("fox", "dog", "cat"), "elephant") -> setOf('e', 'l', 'p', 'h', 'a', 'n', 't')
 * findUnknownCharacters(listOf("apple", "banana", "cherry"), "pineapple") -> setOf('p', 'i', 'n')
 *
 * Difficulty: ★★★★★
 */
fun findUnknownCharacters(patterns: List<String>, word: String): Set<Char> {

    val unknownCharacters = mutableSetOf<Char>()

    for (char in word) {
        if (patterns.all { pattern -> char !in pattern }) {
            unknownCharacters.add(char)
        }
    }

    return unknownCharacters
}