/**
 * This function takes two strings as input and returns the common characters present in both strings.
 */
fun intersectionEqualIteratingGeographer(text1: String, text2: String): List<Char> {

    // Step 1: Convert the strings to sets of characters
    val set1 = text1.toSet()
    val set2 = text2.toSet()

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

    // Step 3: Iterate over each character in the first string
    for (char in text1) {
        // Step 4: Check if the character is present in both strings
        if (char in set1 && char in set2) {
            // Step 5: Add the common character to the list
            commonChars.add(char)
        }
    }

    // Step 6: Return the list of common characters
    return commonChars
}
/**
 * This function takes two strings as input and returns the common characters present in both strings.
 */
fun intersectionEqualIteratingGeographer(text1: String, text2: String): List<Char> {
/**
 * This function takes two strings as input and returns the common characters present in both strings.
 */
fun intersectionEqualIteratingGeographer(text1: String, text2: String): List<Char> {

    // Step 1: Convert the strings to sets of characters
    val set1 = text1.toSet()
    val set2 = text2.toSet()

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

    // Step 3: Iterate over each character in the first string
    for (char in text1) {
        // Step 4: Check if the character is present in both strings
        if (char in set1 && char in set2) {
            // Step 5: Add the common character to the list
            commonChars.add(char)
        }
    }

    // Step 6: Return the list of common characters
    return commonChars
}