/**
 * Given two strings representing the names of an actor and actress, write a program to find the number of common characters
 * in their names using nested for loops.
 *
 * @param str1 a string representing the name of an actor
 * @param str2 a string representing the name of an actress
 * @return count an integer representing the number of common characters in the actor and actress names
 */
fun countCommonChars(str1: String, str2: String): Int {

    // Initialize a counter to keep track of common characters
    var count = 0

    // Iterate through each character in the actor's name
    for (char1 in str1) {
        // Iterate through each character in the actress's name
        for (char2 in str2) {
            // Check if the current characters are the same
            if (char1 == char2) {
                // Increment the common character count
                count++
            }
        }
    }

    return count
}
/**
 * Given two strings representing the names of an actor and actress, write a program to find the number of common characters
 * in their names using nested for loops.
 *
 * @param str1 a string representing the name of an actor
 * @param str2 a string representing the name of an actress
 * @return count an integer representing the number of common characters in the actor and actress names
 */
fun countCommonChars(str1: String, str2: String): Int {
/**
 * Given two strings representing the names of an actor and actress, write a program to find the number of common characters
 * in their names using nested for loops.
 *
 * @param str1 a string representing the name of an actor
 * @param str2 a string representing the name of an actress
 * @return count an integer representing the number of common characters in the actor and actress names
 */
fun countCommonChars(str1: String, str2: String): Int {

    // Initialize a counter to keep track of common characters
    var count = 0

    // Iterate through each character in the actor's name
    for (char1 in str1) {
        // Iterate through each character in the actress's name
        for (char2 in str2) {
            // Check if the current characters are the same
            if (char1 == char2) {
                // Increment the common character count
                count++
            }
        }
    }

    return count
}