/**
 * Given two lists, find the common elements between them.
 *
 * @param data1 The first list containing elements.
 * @param data2 The second list containing elements.
 * @return A list containing the common elements between data1 and data2.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> listOf(3, 4)
 * findCommonElements(listOf("apple", "banana", "orange"), listOf("banana", "watermelon")) -> listOf("banana")
 * findCommonElements(listOf(1.0, 2.3, 5.6), listOf(1.0, 2.3, 5.6, 7.8)) -> listOf(1.0, 2.3, 5.6)
 */
fun findCommonElements(data1: List<Any>, data2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()
    for (element1 in data1) {
        for (element2 in data2) {
            if (element1 == element2) {
                commonElements.add(element1)
            }
        }
    }
    return commonElements
}
/**
 * Given two lists, find the common elements between them.
 *
 * @param data1 The first list containing elements.
 * @param data2 The second list containing elements.
 * @return A list containing the common elements between data1 and data2.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> listOf(3, 4)
 * findCommonElements(listOf("apple", "banana", "orange"), listOf("banana", "watermelon")) -> listOf("banana")
 * findCommonElements(listOf(1.0, 2.3, 5.6), listOf(1.0, 2.3, 5.6, 7.8)) -> listOf(1.0, 2.3, 5.6)
 */
fun findCommonElements(data1: List<Any>, data2: List<Any>): List<Any> {
/**
 * Given two lists, find the common elements between them.
 *
 * @param data1 The first list containing elements.
 * @param data2 The second list containing elements.
 * @return A list containing the common elements between data1 and data2.
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> listOf(3, 4)
 * findCommonElements(listOf("apple", "banana", "orange"), listOf("banana", "watermelon")) -> listOf("banana")
 * findCommonElements(listOf(1.0, 2.3, 5.6), listOf(1.0, 2.3, 5.6, 7.8)) -> listOf(1.0, 2.3, 5.6)
 */
fun findCommonElements(data1: List<Any>, data2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()
    for (element1 in data1) {
        for (element2 in data2) {
            if (element1 == element2) {
                commonElements.add(element1)
            }
        }
    }
    return commonElements
}