/**
 * Write a function that takes in two lists as input and returns a list of common elements between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common elements between list1 and list2.
 *
 * Examples:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 * findCommonElements(listOf("a", "b", "c"), listOf("b", "c", "d")) // ["b", "c"]
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Iterate through each element in list1
    for (element in list1) {
        // Check if the element is present in list2
        if (element in list2) {
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * Write a function that takes in two lists as input and returns a list of common elements between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common elements between list1 and list2.
 *
 * Examples:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 * findCommonElements(listOf("a", "b", "c"), listOf("b", "c", "d")) // ["b", "c"]
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Write a function that takes in two lists as input and returns a list of common elements between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A list of common elements between list1 and list2.
 *
 * Examples:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // [3, 4]
 * findCommonElements(listOf("a", "b", "c"), listOf("b", "c", "d")) // ["b", "c"]
 */
fun findCommonElements(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    // Iterate through each element in list1
    for (element in list1) {
        // Check if the element is present in list2
        if (element in list2) {
            commonElements.add(element)
        }
    }

    return commonElements
}