/**
 * Write a function that takes in two actor names as arguments and returns a list containing the common letters
 * in the names, disregarding case sensitivity. The function should exclude any vowels (a, e, i, o, u).
 *
 * @param actorOne The name of the first actor.
 * @param actorTwo The name of the second actor.
 * @return A list containing the common letters, excluding vowels.
 *
 * Example:
 * findCommonLetters("Johnny Depp", "Penelope Cruz") -> ['n', 'y', ' ', 'D', 'p']
 */
fun findCommonLetters(actorOne: String, actorTwo: String): List<Char> {

    val commonLetters = mutableListOf<Char>()

    for (char in actorOne.toLowerCase()) {
        if (char.isLetter() && char !in "aeiou" && char in actorTwo.toLowerCase()) {
            commonLetters.add(if (char.isUpperCase()) char.toUpperCase() else char)
        }
    }

    return commonLetters
}
/**
 * Write a function that takes in two actor names as arguments and returns a list containing the common letters
 * in the names, disregarding case sensitivity. The function should exclude any vowels (a, e, i, o, u).
 *
 * @param actorOne The name of the first actor.
 * @param actorTwo The name of the second actor.
 * @return A list containing the common letters, excluding vowels.
 *
 * Example:
 * findCommonLetters("Johnny Depp", "Penelope Cruz") -> ['n', 'y', ' ', 'D', 'p']
 */
fun findCommonLetters(actorOne: String, actorTwo: String): List<Char> {
/**
 * Write a function that takes in two actor names as arguments and returns a list containing the common letters
 * in the names, disregarding case sensitivity. The function should exclude any vowels (a, e, i, o, u).
 *
 * @param actorOne The name of the first actor.
 * @param actorTwo The name of the second actor.
 * @return A list containing the common letters, excluding vowels.
 *
 * Example:
 * findCommonLetters("Johnny Depp", "Penelope Cruz") -> ['n', 'y', ' ', 'D', 'p']
 */
fun findCommonLetters(actorOne: String, actorTwo: String): List<Char> {

    val commonLetters = mutableListOf<Char>()

    for (char in actorOne.toLowerCase()) {
        if (char.isLetter() && char !in "aeiou" && char in actorTwo.toLowerCase()) {
            commonLetters.add(if (char.isUpperCase()) char.toUpperCase() else char)
        }
    }

    return commonLetters
}