/**
 * This function takes a dictionary and a string as input. It iterates over the keys of the dictionary and checks if each
 * character in the key is present in the string. The function then returns the concatenated string of all the characters
 * that are present in both the keys and the string.
 *
 * @param dictionary The dictionary to iterate over.
 * @param string The string to check for matching characters.
 * @return The string containing all the characters that are present in both the keys and the string.
 *
 * Example:
 * val dictionary = mapOf("apple" to 1, "banana" to 2, "cherry" to 3)
 * val string = "bicycle"
 * Output: "ba"
 */
fun findMatchingChars(dictionary: Map<String, Int>, string: String): String {

    var matchingChars = ""

    for (key in dictionary.keys) {
        for (char in key) {
            if (char in string) {
                matchingChars += char
            }
        }
    }

    return matchingChars
}
/**
 * This function takes a dictionary and a string as input. It iterates over the keys of the dictionary and checks if each
 * character in the key is present in the string. The function then returns the concatenated string of all the characters
 * that are present in both the keys and the string.
 *
 * @param dictionary The dictionary to iterate over.
 * @param string The string to check for matching characters.
 * @return The string containing all the characters that are present in both the keys and the string.
 *
 * Example:
 * val dictionary = mapOf("apple" to 1, "banana" to 2, "cherry" to 3)
 * val string = "bicycle"
 * Output: "ba"
 */
fun findMatchingChars(dictionary: Map<String, Int>, string: String): String {
/**
 * This function takes a dictionary and a string as input. It iterates over the keys of the dictionary and checks if each
 * character in the key is present in the string. The function then returns the concatenated string of all the characters
 * that are present in both the keys and the string.
 *
 * @param dictionary The dictionary to iterate over.
 * @param string The string to check for matching characters.
 * @return The string containing all the characters that are present in both the keys and the string.
 *
 * Example:
 * val dictionary = mapOf("apple" to 1, "banana" to 2, "cherry" to 3)
 * val string = "bicycle"
 * Output: "ba"
 */
fun findMatchingChars(dictionary: Map<String, Int>, string: String): String {

    var matchingChars = ""

    for (key in dictionary.keys) {
        for (char in key) {
            if (char in string) {
                matchingChars += char
            }
        }
    }

    return matchingChars
}