/**
 * This exercise requires you to find the common elements in two lists using identity comparison and selection.
 *
 * Your task is to complete the code by implementing the 'findCommonElements" function.
 *
 * You need to find and return a new list that contains the common elements found in both list1 and list2. However,
 * you must use identity comparison (=== operator in Kotlin) to determine if two elements are the same.
 *
 * For example, given list1 = [1, 2, "hello", true] and list2 = [3, "hello", true, 4], the function should return
 * ["hello", true].
 *
 * Your solution should not use any built-in functions or libraries to find common elements.
 *
 * Hints:
 *   - You can use a nested loop to compare each element in list1 with each element in list2.
 *   - To check for common elements using identity comparison, you can use the '===" operator.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // TODO: Complete the code to find the common elements using identity comparison

    return commonElements
}

// Run the test case
val list1 = listOf(1, 2, "hello", true)
/**
 * This exercise requires you to find the common elements in two lists using identity comparison and selection.
 *
 * Your task is to complete the code by implementing the 'findCommonElements" function.
 *
 * You need to find and return a new list that contains the common elements found in both list1 and list2. However,
 * you must use identity comparison (=== operator in Kotlin) to determine if two elements are the same.
 *
 * For example, given list1 = [1, 2, "hello", true] and list2 = [3, "hello", true, 4], the function should return
 * ["hello", true].
 *
 * Your solution should not use any built-in functions or libraries to find common elements.
 *
 * Hints:
 *   - You can use a nested loop to compare each element in list1 with each element in list2.
 *   - To check for common elements using identity comparison, you can use the '===" operator.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This exercise requires you to find the common elements in two lists using identity comparison and selection.
 *
 * Your task is to complete the code by implementing the 'findCommonElements" function.
 *
 * You need to find and return a new list that contains the common elements found in both list1 and list2. However,
 * you must use identity comparison (=== operator in Kotlin) to determine if two elements are the same.
 *
 * For example, given list1 = [1, 2, "hello", true] and list2 = [3, "hello", true, 4], the function should return
 * ["hello", true].
 *
 * Your solution should not use any built-in functions or libraries to find common elements.
 *
 * Hints:
 *   - You can use a nested loop to compare each element in list1 with each element in list2.
 *   - To check for common elements using identity comparison, you can use the '===" operator.
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // TODO: Complete the code to find the common elements using identity comparison

    return commonElements
}

// Run the test case
val list1 = listOf(1, 2, "hello", true)