/**
 * This exercise aims to test your understanding of the XOR operator and the else statement.
 * You need to complete the code to find the common objects between two lists using the XOR operator
 * and an else statement.
 *
 * @param list1 A list of objects
 * @param list2 A list of objects
 * @return A list containing the common objects between list1 and list2
 */
fun findCommonObjects(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonObjs = mutableListOf<Any>()

    // Iterate over the objects in list1
    for (obj1 in list1) {
        // Iterate over the objects in list2
        for (obj2 in list2) {
            // Use the XOR operator to check if obj1 is equal to obj2
            if (obj1 == obj2) {
                // Add the common object to the list
                commonObjs.add(obj1)
            } else {
                // Add the common object to the list
                commonObjs.add(obj2)
            }
        }
    }

    return commonObjs
}
/**
 * This exercise aims to test your understanding of the XOR operator and the else statement.
 * You need to complete the code to find the common objects between two lists using the XOR operator
 * and an else statement.
 *
 * @param list1 A list of objects
 * @param list2 A list of objects
 * @return A list containing the common objects between list1 and list2
 */
fun findCommonObjects(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This exercise aims to test your understanding of the XOR operator and the else statement.
 * You need to complete the code to find the common objects between two lists using the XOR operator
 * and an else statement.
 *
 * @param list1 A list of objects
 * @param list2 A list of objects
 * @return A list containing the common objects between list1 and list2
 */
fun findCommonObjects(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonObjs = mutableListOf<Any>()

    // Iterate over the objects in list1
    for (obj1 in list1) {
        // Iterate over the objects in list2
        for (obj2 in list2) {
            // Use the XOR operator to check if obj1 is equal to obj2
            if (obj1 == obj2) {
                // Add the common object to the list
                commonObjs.add(obj1)
            } else {
                // Add the common object to the list
                commonObjs.add(obj2)
            }
        }
    }

    return commonObjs
}