/**
 * Given two lists, return a tuple containing the elements that are common between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A tuple containing the common elements between list1 and list2.
 *
 * Example:
 * intersectionOfLists(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // Output: (4, 5)
 */
fun intersectionOfLists(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = list1.filter { it in list2 }
    return commonElements
}
/**
 * Given two lists, return a tuple containing the elements that are common between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A tuple containing the common elements between list1 and list2.
 *
 * Example:
 * intersectionOfLists(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // Output: (4, 5)
 */
fun intersectionOfLists(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists, return a tuple containing the elements that are common between them.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return A tuple containing the common elements between list1 and list2.
 *
 * Example:
 * intersectionOfLists(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7, 8)) // Output: (4, 5)
 */
fun intersectionOfLists(list1: List<Int>, list2: List<Int>): List<Int> {

    val commonElements = list1.filter { it in list2 }
    return commonElements
}