/**
 * This function takes in a list of strings and returns a list of common characters in all of the strings.
 */
fun findCommonChars(stringList: List<String>): List<Char> {

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

    // Get the first string in the list
    val firstString = stringList[0]

    // Loop through each character in the first string
    for (char in firstString) {
        // Initialize a flag to check if the character is common in all strings
        var isCommon = true

        // Loop through each string in the list starting from the second string
        for (string in stringList.subList(1, stringList.size)) {
            // Check if the character is present in the current string
            if (char !in string) {
                // If the character is not present, set the flag to False and break the loop
                isCommon = false
                break
            }
        }

        // If the flag is still True after checking all strings, add the character to the commonChars list
        if (isCommon) {
            commonChars.add(char)
        }
    }

    return commonChars
}
/**
 * This function takes in a list of strings and returns a list of common characters in all of the strings.
 */
fun findCommonChars(stringList: List<String>): List<Char> {
/**
 * This function takes in a list of strings and returns a list of common characters in all of the strings.
 */
fun findCommonChars(stringList: List<String>): List<Char> {

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

    // Get the first string in the list
    val firstString = stringList[0]

    // Loop through each character in the first string
    for (char in firstString) {
        // Initialize a flag to check if the character is common in all strings
        var isCommon = true

        // Loop through each string in the list starting from the second string
        for (string in stringList.subList(1, stringList.size)) {
            // Check if the character is present in the current string
            if (char !in string) {
                // If the character is not present, set the flag to False and break the loop
                isCommon = false
                break
            }
        }

        // If the flag is still True after checking all strings, add the character to the commonChars list
        if (isCommon) {
            commonChars.add(char)
        }
    }

    return commonChars
}