/**
 * Given two lists, the function intersectionOfLists should return a list containing their
 * common elements.
 *
 * @param list1 The first input list.
 * @param list2 The second input list.
 * @return A list containing common elements from both input lists.
 */
fun intersectionOfLists(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    for (element in list1) {
        if (element in list2 && element !in commonElements) {
            commonElements.add(element)
        }
    }

    return commonElements
}
/**
 * Given two lists, the function intersectionOfLists should return a list containing their
 * common elements.
 *
 * @param list1 The first input list.
 * @param list2 The second input list.
 * @return A list containing common elements from both input lists.
 */
fun intersectionOfLists(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * Given two lists, the function intersectionOfLists should return a list containing their
 * common elements.
 *
 * @param list1 The first input list.
 * @param list2 The second input list.
 * @return A list containing common elements from both input lists.
 */
fun intersectionOfLists(list1: List<Any>, list2: List<Any>): List<Any> {

    val commonElements = mutableListOf<Any>()

    for (element in list1) {
        if (element in list2 && element !in commonElements) {
            commonElements.add(element)
        }
    }

    return commonElements
}