/**
 * This exercise requires you to find the common characters between two different data structures - tuples and strings.
 * You will need to use indexing and slicing techniques to extract specific elements from the tuples, and iterate over the
 * characters of a string using loops. The goal is to identify common characters between the specified fabric names and
 * the color code string.
 *
 * @param fabrics A tuple of fabric names (e.g. listOf("cotton", "silk", "wool", "polyester"))
 * @param colorCode A string representing a color code (e.g. "cotpaul")
 * @return A list of common characters found both in the fabric names and the color code string
 */
fun findCommonCharacters(fabrics: List<String>, colorCode: String): List<Char> {

    val commonChars = mutableListOf<Char>()
    for (fabric in fabrics) {
        for (char in fabric) {
            if (char in colorCode && char !in commonChars) {
                commonChars.add(char)
            }
        }
    }
    return commonChars
}
/**
 * This exercise requires you to find the common characters between two different data structures - tuples and strings.
 * You will need to use indexing and slicing techniques to extract specific elements from the tuples, and iterate over the
 * characters of a string using loops. The goal is to identify common characters between the specified fabric names and
 * the color code string.
 *
 * @param fabrics A tuple of fabric names (e.g. listOf("cotton", "silk", "wool", "polyester"))
 * @param colorCode A string representing a color code (e.g. "cotpaul")
 * @return A list of common characters found both in the fabric names and the color code string
 */
fun findCommonCharacters(fabrics: List<String>, colorCode: String): List<Char> {
/**
 * This exercise requires you to find the common characters between two different data structures - tuples and strings.
 * You will need to use indexing and slicing techniques to extract specific elements from the tuples, and iterate over the
 * characters of a string using loops. The goal is to identify common characters between the specified fabric names and
 * the color code string.
 *
 * @param fabrics A tuple of fabric names (e.g. listOf("cotton", "silk", "wool", "polyester"))
 * @param colorCode A string representing a color code (e.g. "cotpaul")
 * @return A list of common characters found both in the fabric names and the color code string
 */
fun findCommonCharacters(fabrics: List<String>, colorCode: String): List<Char> {

    val commonChars = mutableListOf<Char>()
    for (fabric in fabrics) {
        for (char in fabric) {
            if (char in colorCode && char !in commonChars) {
                commonChars.add(char)
            }
        }
    }
    return commonChars
}