/**
 * This exercise is to help the Marketing Manager to find the common characters between two strings using an unconditioned ternary operator and a while loop.
 * The function takes two strings as arguments and returns a list of common characters found in both strings.
 *
 * Example:
 * find_common_chars("hello", "world") should return ['l', 'o'].
 *
 * Your task is to complete the code below by using an unconditioned ternary operator and a while loop to solve the exercise.
 */
fun findCommonChars(str1: String, str2: String): List<Char> {

    val commonChars = mutableListOf<Char>()
    var i = 0
    while (i < str1.length) {
        if (str1[i] in str2) {
            commonChars.add(str1[i])
        }
        i++
    }
    return commonChars
}
/**
 * This exercise is to help the Marketing Manager to find the common characters between two strings using an unconditioned ternary operator and a while loop.
 * The function takes two strings as arguments and returns a list of common characters found in both strings.
 *
 * Example:
 * find_common_chars("hello", "world") should return ['l', 'o'].
 *
 * Your task is to complete the code below by using an unconditioned ternary operator and a while loop to solve the exercise.
 */
fun findCommonChars(str1: String, str2: String): List<Char> {
/**
 * This exercise is to help the Marketing Manager to find the common characters between two strings using an unconditioned ternary operator and a while loop.
 * The function takes two strings as arguments and returns a list of common characters found in both strings.
 *
 * Example:
 * find_common_chars("hello", "world") should return ['l', 'o'].
 *
 * Your task is to complete the code below by using an unconditioned ternary operator and a while loop to solve the exercise.
 */
fun findCommonChars(str1: String, str2: String): List<Char> {

    val commonChars = mutableListOf<Char>()
    var i = 0
    while (i < str1.length) {
        if (str1[i] in str2) {
            commonChars.add(str1[i])
        }
        i++
    }
    return commonChars
}