/**
 * This function takes two strings as input and returns the number of common characters found in both strings.
 *
 * @param string1 The first string to compare.
 * @param string2 The second string to compare.
 * @return The count of common characters found in both strings.
 *
 * Example:
 * countCommonChars("hello", "world") // 2
 */
fun countCommonChars(string1: String, string2: String): Int {

    val commonChars = mutableListOf<Char>()
    for (char in string1) {
        if (char in string2 && char !in commonChars) {
            commonChars.add(char)
        }
    }
    return commonChars.size
}
/**
 * This function takes two strings as input and returns the number of common characters found in both strings.
 *
 * @param string1 The first string to compare.
 * @param string2 The second string to compare.
 * @return The count of common characters found in both strings.
 *
 * Example:
 * countCommonChars("hello", "world") // 2
 */
fun countCommonChars(string1: String, string2: String): Int {
/**
 * This function takes two strings as input and returns the number of common characters found in both strings.
 *
 * @param string1 The first string to compare.
 * @param string2 The second string to compare.
 * @return The count of common characters found in both strings.
 *
 * Example:
 * countCommonChars("hello", "world") // 2
 */
fun countCommonChars(string1: String, string2: String): Int {

    val commonChars = mutableListOf<Char>()
    for (char in string1) {
        if (char in string2 && char !in commonChars) {
            commonChars.add(char)
        }
    }
    return commonChars.size
}