/**
 * This function returns the common characters found at the same index in both input strings.
 * It utilizes the short-circuiting property of logical operators and various string methods.
 *
 * @param string1 The first input string.
 * @param string2 The second input string.
 * @return The common characters found at the same index in both input strings.
 */
fun stringIntersection(string1: String, string2: String): String {

    var commonChars = ""

    // Iterate through both strings simultaneously
    for ((char1, char2) in string1.zip(string2)) {
        // Check if characters at the same index are equal and non-empty
        if (char1 != ' ' && char2 != ' ' && char1 == char2) {
            commonChars += char1
        }
    }

    return commonChars
}
/**
 * This function returns the common characters found at the same index in both input strings.
 * It utilizes the short-circuiting property of logical operators and various string methods.
 *
 * @param string1 The first input string.
 * @param string2 The second input string.
 * @return The common characters found at the same index in both input strings.
 */
fun stringIntersection(string1: String, string2: String): String {
/**
 * This function returns the common characters found at the same index in both input strings.
 * It utilizes the short-circuiting property of logical operators and various string methods.
 *
 * @param string1 The first input string.
 * @param string2 The second input string.
 * @return The common characters found at the same index in both input strings.
 */
fun stringIntersection(string1: String, string2: String): String {

    var commonChars = ""

    // Iterate through both strings simultaneously
    for ((char1, char2) in string1.zip(string2)) {
        // Check if characters at the same index are equal and non-empty
        if (char1 != ' ' && char2 != ' ' && char1 == char2) {
            commonChars += char1
        }
    }

    return commonChars
}