/**
 * Given two arrays of colors, find the common colors between them using the XOR operator.
 *
 * @param colorArray1 The first array of colors.
 * @param colorArray2 The second array of colors.
 * @return A new array containing the common colors.
 *
 * Example:
 * getCommonColors(arrayOf("red", "green", "blue"), arrayOf("blue", "yellow", "red")) // Returns ["red", "blue"]
 * getCommonColors(arrayOf("pink", "purple", "orange"), arrayOf("red", "green", "blue")) // Returns empty list
 *
 * Note:
 * The XOR operator (^) compares corresponding bits of two numbers and returns 1 if they are different,
 * and 0 if they are the same.
 * In this case, we can use it to compare each element of the two arrays and create a new array with only
 * the common colors.
 */
fun getCommonColors(colorArray1: Array<String>, colorArray2: Array<String>): List<String> {

    val commonColors = mutableListOf<String>()

    for (i in colorArray1.indices) {
        if (colorArray1[i] == colorArray2[i]) {
            commonColors.add(colorArray1[i])
        }
    }

    return commonColors
}
/**
 * Given two arrays of colors, find the common colors between them using the XOR operator.
 *
 * @param colorArray1 The first array of colors.
 * @param colorArray2 The second array of colors.
 * @return A new array containing the common colors.
 *
 * Example:
 * getCommonColors(arrayOf("red", "green", "blue"), arrayOf("blue", "yellow", "red")) // Returns ["red", "blue"]
 * getCommonColors(arrayOf("pink", "purple", "orange"), arrayOf("red", "green", "blue")) // Returns empty list
 *
 * Note:
 * The XOR operator (^) compares corresponding bits of two numbers and returns 1 if they are different,
 * and 0 if they are the same.
 * In this case, we can use it to compare each element of the two arrays and create a new array with only
 * the common colors.
 */
fun getCommonColors(colorArray1: Array<String>, colorArray2: Array<String>): List<String> {
/**
 * Given two arrays of colors, find the common colors between them using the XOR operator.
 *
 * @param colorArray1 The first array of colors.
 * @param colorArray2 The second array of colors.
 * @return A new array containing the common colors.
 *
 * Example:
 * getCommonColors(arrayOf("red", "green", "blue"), arrayOf("blue", "yellow", "red")) // Returns ["red", "blue"]
 * getCommonColors(arrayOf("pink", "purple", "orange"), arrayOf("red", "green", "blue")) // Returns empty list
 *
 * Note:
 * The XOR operator (^) compares corresponding bits of two numbers and returns 1 if they are different,
 * and 0 if they are the same.
 * In this case, we can use it to compare each element of the two arrays and create a new array with only
 * the common colors.
 */
fun getCommonColors(colorArray1: Array<String>, colorArray2: Array<String>): List<String> {

    val commonColors = mutableListOf<String>()

    for (i in colorArray1.indices) {
        if (colorArray1[i] == colorArray2[i]) {
            commonColors.add(colorArray1[i])
        }
    }

    return commonColors
}