/**
 * Create a tuple from a string and find the common letters between two strings.
 *
 * @param string1 The first string.
 * @param string2 The second string.
 * @return A tuple containing the common letters between the two strings.
 *
 * Example:
 * getCommonLetters("hello", "world") // ('l', 'o')
 * getCommonLetters("python", "programming") // ('p', 'o', 'g', 'r', 'a', 'm')
 * getCommonLetters("apple", "banana") // ('a',)
 */
fun getCommonLetters(string1: String, string2: String): List<Char> {

    // Convert the strings into sets of characters
    val set1 = string1.toSet()
    val set2 = string2.toSet()

    // Find the common letters by intersecting the two sets
    val commonLetters = set1.intersect(set2)

    // Convert the set into a sorted list and return it
    return commonLetters.sorted()
}
/**
 * Create a tuple from a string and find the common letters between two strings.
 *
 * @param string1 The first string.
 * @param string2 The second string.
 * @return A tuple containing the common letters between the two strings.
 *
 * Example:
 * getCommonLetters("hello", "world") // ('l', 'o')
 * getCommonLetters("python", "programming") // ('p', 'o', 'g', 'r', 'a', 'm')
 * getCommonLetters("apple", "banana") // ('a',)
 */
fun getCommonLetters(string1: String, string2: String): List<Char> {
/**
 * Create a tuple from a string and find the common letters between two strings.
 *
 * @param string1 The first string.
 * @param string2 The second string.
 * @return A tuple containing the common letters between the two strings.
 *
 * Example:
 * getCommonLetters("hello", "world") // ('l', 'o')
 * getCommonLetters("python", "programming") // ('p', 'o', 'g', 'r', 'a', 'm')
 * getCommonLetters("apple", "banana") // ('a',)
 */
fun getCommonLetters(string1: String, string2: String): List<Char> {

    // Convert the strings into sets of characters
    val set1 = string1.toSet()
    val set2 = string2.toSet()

    // Find the common letters by intersecting the two sets
    val commonLetters = set1.intersect(set2)

    // Convert the set into a sorted list and return it
    return commonLetters.sorted()
}