/**
 * This exercise is to find the characters that are present in both given strings.
 *
 * @param string1 A string containing characters.
 * @param string2 A string containing characters.
 * @return A set of characters that are present in both string1 and string2.
 *
 * Example:
 * findSharedCharacters("hello", "world") -> setOf('o', 'l')
 */
fun findSharedCharacters(string1: String, string2: String): Set<Char> {

    val commonCharacters = mutableSetOf<Char>()

    for (char1 in string1) {
        for (char2 in string2) {
            if (char1 == char2) {
                commonCharacters.add(char1)
            }
        }
    }

    return commonCharacters
}
/**
 * This exercise is to find the characters that are present in both given strings.
 *
 * @param string1 A string containing characters.
 * @param string2 A string containing characters.
 * @return A set of characters that are present in both string1 and string2.
 *
 * Example:
 * findSharedCharacters("hello", "world") -> setOf('o', 'l')
 */
fun findSharedCharacters(string1: String, string2: String): Set<Char> {
/**
 * This exercise is to find the characters that are present in both given strings.
 *
 * @param string1 A string containing characters.
 * @param string2 A string containing characters.
 * @return A set of characters that are present in both string1 and string2.
 *
 * Example:
 * findSharedCharacters("hello", "world") -> setOf('o', 'l')
 */
fun findSharedCharacters(string1: String, string2: String): Set<Char> {

    val commonCharacters = mutableSetOf<Char>()

    for (char1 in string1) {
        for (char2 in string2) {
            if (char1 == char2) {
                commonCharacters.add(char1)
            }
        }
    }

    return commonCharacters
}