/**
 * Return a list of common elements between two arrays using list comprehension.
 *
 * @param arr1 The first input array.
 * @param arr2 The second input array.
 * @return A list containing common elements between the two arrays.
 *
 * Example:
 * commonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7)) -> [4, 5]
 */
fun commonElements(arr1: List<Int>, arr2: List<Int>): List<Int> {

    return arr1.filter { it in arr2 }
}

// Now, let's test the function
/**
 * Return a list of common elements between two arrays using list comprehension.
 *
 * @param arr1 The first input array.
 * @param arr2 The second input array.
 * @return A list containing common elements between the two arrays.
 *
 * Example:
 * commonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7)) -> [4, 5]
 */
fun commonElements(arr1: List<Int>, arr2: List<Int>): List<Int> {
/**
 * Return a list of common elements between two arrays using list comprehension.
 *
 * @param arr1 The first input array.
 * @param arr2 The second input array.
 * @return A list containing common elements between the two arrays.
 *
 * Example:
 * commonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7)) -> [4, 5]
 */
fun commonElements(arr1: List<Int>, arr2: List<Int>): List<Int> {

    return arr1.filter { it in arr2 }
}

// Now, let's test the function