/**
 * This function takes two strings as input and returns a list of characters that are common in both strings.
 * The function uses loops to iterate through each character of the first string and checks if it exists in the second string.
 *
 * @param string1 The first input string.
 * @param string2 The second input string.
 * @return A list of characters that are common in both strings.
 */
fun findCommonCharacters(string1: String, string2: String): List<Char> {

    val commonChars = mutableListOf<Char>()

    for (char in string1) {
        if (char in string2) {
            commonChars.add(char)
        }
    }

    return commonChars
}
/**
 * This function takes two strings as input and returns a list of characters that are common in both strings.
 * The function uses loops to iterate through each character of the first string and checks if it exists in the second string.
 *
 * @param string1 The first input string.
 * @param string2 The second input string.
 * @return A list of characters that are common in both strings.
 */
fun findCommonCharacters(string1: String, string2: String): List<Char> {
/**
 * This function takes two strings as input and returns a list of characters that are common in both strings.
 * The function uses loops to iterate through each character of the first string and checks if it exists in the second string.
 *
 * @param string1 The first input string.
 * @param string2 The second input string.
 * @return A list of characters that are common in both strings.
 */
fun findCommonCharacters(string1: String, string2: String): List<Char> {

    val commonChars = mutableListOf<Char>()

    for (char in string1) {
        if (char in string2) {
            commonChars.add(char)
        }
    }

    return commonChars
}