/**
 * This function takes a list of pet names and finds the common letters among all the names.
 *
 * @param petNames A list of strings representing pet names.
 * @return A list of characters that are common among all the pet names.
 */
fun findCommonLetters(petNames: List<String>): List<Char> {

    val commonLetters = mutableListOf<Char>()

    for (char in petNames[0]) {
        var isCommon = true

        for (petName in petNames.subList(1, petNames.size)) {
            if (char !in petName) {
                isCommon = false
                break
            }
        }

        if (isCommon) {
            commonLetters.add(char)
        }
    }

    return commonLetters
}

// Example Usage
val names = listOf("Simba", "Milo", "Luna")
val commonChars = findCommonLetters(names)
/**
 * This function takes a list of pet names and finds the common letters among all the names.
 *
 * @param petNames A list of strings representing pet names.
 * @return A list of characters that are common among all the pet names.
 */
fun findCommonLetters(petNames: List<String>): List<Char> {
/**
 * This function takes a list of pet names and finds the common letters among all the names.
 *
 * @param petNames A list of strings representing pet names.
 * @return A list of characters that are common among all the pet names.
 */
fun findCommonLetters(petNames: List<String>): List<Char> {

    val commonLetters = mutableListOf<Char>()

    for (char in petNames[0]) {
        var isCommon = true

        for (petName in petNames.subList(1, petNames.size)) {
            if (char !in petName) {
                isCommon = false
                break
            }
        }

        if (isCommon) {
            commonLetters.add(char)
        }
    }

    return commonLetters
}

// Example Usage
val names = listOf("Simba", "Milo", "Luna")
val commonChars = findCommonLetters(names)