/**
 * The function takes two strings as input and returns a set of characters that are common in both strings.
 *
 * @param string1 a string
 * @param string2 a string
 * @return a set of characters that are common in both strings
 */
fun commonCharacters(string1: String, string2: String): Set<Char> {

    val common = mutableSetOf<Char>()
    var modifiedString2 = string2
    for (char in string1) {
        for (i in modifiedString2.indices) {
            if (char == modifiedString2[i]) {
                common.add(char)
                modifiedString2 = modifiedString2.removeRange(i, i + 1)
                break
            }
        }
    }
    return common
}
/**
 * The function takes two strings as input and returns a set of characters that are common in both strings.
 *
 * @param string1 a string
 * @param string2 a string
 * @return a set of characters that are common in both strings
 */
fun commonCharacters(string1: String, string2: String): Set<Char> {
/**
 * The function takes two strings as input and returns a set of characters that are common in both strings.
 *
 * @param string1 a string
 * @param string2 a string
 * @return a set of characters that are common in both strings
 */
fun commonCharacters(string1: String, string2: String): Set<Char> {

    val common = mutableSetOf<Char>()
    var modifiedString2 = string2
    for (char in string1) {
        for (i in modifiedString2.indices) {
            if (char == modifiedString2[i]) {
                common.add(char)
                modifiedString2 = modifiedString2.removeRange(i, i + 1)
                break
            }
        }
    }
    return common
}