/**
 * This function takes two strings as input and returns a string containing the common characters between them.
 * It uses iteration and string indexing to solve the exercise.
 */
fun findCommonChars(str1: String, str2: String): String {

    var commonChars = ""

    // Iterate over each character in the first string
    for (char in str1) {
        // Check if the character exists in the second string and is not already present in the commonChars string
        if (char in str2 && char !in commonChars) {
            // Add the character to the commonChars string
            commonChars += char
        }
    }

    return commonChars
}
/**
 * This function takes two strings as input and returns a string containing the common characters between them.
 * It uses iteration and string indexing to solve the exercise.
 */
fun findCommonChars(str1: String, str2: String): String {
/**
 * This function takes two strings as input and returns a string containing the common characters between them.
 * It uses iteration and string indexing to solve the exercise.
 */
fun findCommonChars(str1: String, str2: String): String {

    var commonChars = ""

    // Iterate over each character in the first string
    for (char in str1) {
        // Check if the character exists in the second string and is not already present in the commonChars string
        if (char in str2 && char !in commonChars) {
            // Add the character to the commonChars string
            commonChars += char
        }
    }

    return commonChars
}