/**
 * Given two arrays of integers, find the common elements between them and return a new array
 * containing those values.
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7)) -> [4, 5]
 */
fun findCommonElements(arr1: List<Int>, arr2: List<Int>): List<Int> {

    return (arr1.toSet() intersect arr2.toSet()).toList()
}
/**
 * Given two arrays of integers, find the common elements between them and return a new array
 * containing those values.
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7)) -> [4, 5]
 */
fun findCommonElements(arr1: List<Int>, arr2: List<Int>): List<Int> {
/**
 * Given two arrays of integers, find the common elements between them and return a new array
 * containing those values.
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4, 5), listOf(4, 5, 6, 7)) -> [4, 5]
 */
fun findCommonElements(arr1: List<Int>, arr2: List<Int>): List<Int> {

    return (arr1.toSet() intersect arr2.toSet()).toList()
}