/**
 * This function takes two actor names, converts each name into a set of characters,
 * and finds the common characters between them using nested loops and while loop.
 *
 * @param actor1 The name of the first actor/actress
 * @param actor2 The name of the second actor/actress
 * @return A set of characters that are common between the two names
 */
fun findCommonCharacters(actor1: String, actor2: String): Set<Char> {

    val commonCharacters = mutableSetOf<Char>()
    var i = 0
    while (i < actor1.length) {  // Loop through the characters of the first actor's name
        var j = 0
        while (j < actor2.length) {  // Loop through the characters of the second actor's name
            if (actor1[i] == actor2[j]) {  // Check if the characters are the same
                commonCharacters.add(actor1[i])  // Add the common character to the set
            }
            j++
        }
        i++
    }
    return commonCharacters
}
/**
 * This function takes two actor names, converts each name into a set of characters,
 * and finds the common characters between them using nested loops and while loop.
 *
 * @param actor1 The name of the first actor/actress
 * @param actor2 The name of the second actor/actress
 * @return A set of characters that are common between the two names
 */
fun findCommonCharacters(actor1: String, actor2: String): Set<Char> {
/**
 * This function takes two actor names, converts each name into a set of characters,
 * and finds the common characters between them using nested loops and while loop.
 *
 * @param actor1 The name of the first actor/actress
 * @param actor2 The name of the second actor/actress
 * @return A set of characters that are common between the two names
 */
fun findCommonCharacters(actor1: String, actor2: String): Set<Char> {

    val commonCharacters = mutableSetOf<Char>()
    var i = 0
    while (i < actor1.length) {  // Loop through the characters of the first actor's name
        var j = 0
        while (j < actor2.length) {  // Loop through the characters of the second actor's name
            if (actor1[i] == actor2[j]) {  // Check if the characters are the same
                commonCharacters.add(actor1[i])  // Add the common character to the set
            }
            j++
        }
        i++
    }
    return commonCharacters
}