/**
 * Given a list of colors and patterns, return a list of intersection colors that are common in both.
 *
 * @param colors A list of colors.
 * @param patterns A list of patterns.
 * @return A list of intersection colors.
 *
 * Example:
 * getCommonColors(listOf("red", "blue", "green"), listOf("stripes", "floral", "blue")) // Output: ["blue"]
 * getCommonColors(listOf("yellow", "black", "red"), listOf("stripes", "plaid")) // Output: []
 */
fun getCommonColors(colors: List<String>, patterns: List<String>): List<String> {

    val commonColors = mutableListOf<String>()

    for (color in colors) {
        for (pattern in patterns) {
            if (color == pattern) {
                commonColors.add(color)
            }
        }
    }

    return commonColors
}
/**
 * Given a list of colors and patterns, return a list of intersection colors that are common in both.
 *
 * @param colors A list of colors.
 * @param patterns A list of patterns.
 * @return A list of intersection colors.
 *
 * Example:
 * getCommonColors(listOf("red", "blue", "green"), listOf("stripes", "floral", "blue")) // Output: ["blue"]
 * getCommonColors(listOf("yellow", "black", "red"), listOf("stripes", "plaid")) // Output: []
 */
fun getCommonColors(colors: List<String>, patterns: List<String>): List<String> {
/**
 * Given a list of colors and patterns, return a list of intersection colors that are common in both.
 *
 * @param colors A list of colors.
 * @param patterns A list of patterns.
 * @return A list of intersection colors.
 *
 * Example:
 * getCommonColors(listOf("red", "blue", "green"), listOf("stripes", "floral", "blue")) // Output: ["blue"]
 * getCommonColors(listOf("yellow", "black", "red"), listOf("stripes", "plaid")) // Output: []
 */
fun getCommonColors(colors: List<String>, patterns: List<String>): List<String> {

    val commonColors = mutableListOf<String>()

    for (color in colors) {
        for (pattern in patterns) {
            if (color == pattern) {
                commonColors.add(color)
            }
        }
    }

    return commonColors
}