/**
 * Given two lists, returns a new list containing the common elements between them.
 *
 * Example:
 * commonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7)) -> [4, 5]
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A new list containing the common elements between list1 and list2
 */
fun commonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    return list1.filter { it in list2 }
}
/**
 * Given two lists, returns a new list containing the common elements between them.
 *
 * Example:
 * commonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7)) -> [4, 5]
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A new list containing the common elements between list1 and list2
 */
fun commonElements(list1: List<Int>, list2: List<Int>): List<Int> {
/**
 * Given two lists, returns a new list containing the common elements between them.
 *
 * Example:
 * commonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7)) -> [4, 5]
 *
 * @param list1 The first list
 * @param list2 The second list
 * @return A new list containing the common elements between list1 and list2
 */
fun commonElements(list1: List<Int>, list2: List<Int>): List<Int> {

    return list1.filter { it in list2 }
}