/**
 * Given two sets of characters that appear in the names of two actors,
 * remove the common characters from both sets and return the updated sets.
 *
 * @param actor1 Set of characters appearing in the name of the first actor.
 * @param actor2 Set of characters appearing in the name of the second actor.
 * @return Pair of updated sets after removing common characters.
 */
fun removeCommonCharacters(actor1: MutableSet<Char>, actor2: MutableSet<Char>): Pair<MutableSet<Char>, MutableSet<Char>> {

    // Initialize an empty set to store the common characters
    val commonChars = mutableSetOf<Char>()

    // Iterate over each character in the first actor's set
    for (char1 in actor1.toSet()) {
        // Iterate over each character in the second actor's set
        for (char2 in actor2.toSet()) {
            // Check if the characters match
            if (char1 == char2) {
                // Add the character to the common characters set
                commonChars.add(char1)
                // Break out of the inner loop as we found a match
                break
            }
        }
    }

    // Remove the common characters from both actor sets
    actor1.removeAll(commonChars)
    actor2.removeAll(commonChars)

    return Pair(actor1, actor2)
}
/**
 * Given two sets of characters that appear in the names of two actors,
 * remove the common characters from both sets and return the updated sets.
 *
 * @param actor1 Set of characters appearing in the name of the first actor.
 * @param actor2 Set of characters appearing in the name of the second actor.
 * @return Pair of updated sets after removing common characters.
 */
fun removeCommonCharacters(actor1: MutableSet<Char>, actor2: MutableSet<Char>): Pair<MutableSet<Char>, MutableSet<Char>> {
/**
 * Given two sets of characters that appear in the names of two actors,
 * remove the common characters from both sets and return the updated sets.
 *
 * @param actor1 Set of characters appearing in the name of the first actor.
 * @param actor2 Set of characters appearing in the name of the second actor.
 * @return Pair of updated sets after removing common characters.
 */
fun removeCommonCharacters(actor1: MutableSet<Char>, actor2: MutableSet<Char>): Pair<MutableSet<Char>, MutableSet<Char>> {

    // Initialize an empty set to store the common characters
    val commonChars = mutableSetOf<Char>()

    // Iterate over each character in the first actor's set
    for (char1 in actor1.toSet()) {
        // Iterate over each character in the second actor's set
        for (char2 in actor2.toSet()) {
            // Check if the characters match
            if (char1 == char2) {
                // Add the character to the common characters set
                commonChars.add(char1)
                // Break out of the inner loop as we found a match
                break
            }
        }
    }

    // Remove the common characters from both actor sets
    actor1.removeAll(commonChars)
    actor2.removeAll(commonChars)

    return Pair(actor1, actor2)
}