/**
 * You are a psychologist studying people's memory and attention. In this exercise, you need to find
 * the common elements between two arrays. However, instead of using a regular list, you need to
 * implement your solution using tuples.
 *
 * Your task is to complete the function below, which takes in two arrays (implemented as tuples) as arguments.
 * The function should return a new tuple that contains the common elements between the two input arrays.
 *
 * Example:
 * arr1 = listOf(1, 2, 3, 4, 5)
 * arr2 = listOf(4, 5, 6, 7, 8)
 *
 * Output:
 * (4, 5)
 */
fun findCommonElements(arr1: List<Int>, arr2: List<Int>): List<Int> {

    val commonElements = arr1.toSet() intersect arr2.toSet()
    return commonElements.toList()
}
/**
 * You are a psychologist studying people's memory and attention. In this exercise, you need to find
 * the common elements between two arrays. However, instead of using a regular list, you need to
 * implement your solution using tuples.
 *
 * Your task is to complete the function below, which takes in two arrays (implemented as tuples) as arguments.
 * The function should return a new tuple that contains the common elements between the two input arrays.
 *
 * Example:
 * arr1 = listOf(1, 2, 3, 4, 5)
 * arr2 = listOf(4, 5, 6, 7, 8)
 *
 * Output:
 * (4, 5)
 */
fun findCommonElements(arr1: List<Int>, arr2: List<Int>): List<Int> {
/**
 * You are a psychologist studying people's memory and attention. In this exercise, you need to find
 * the common elements between two arrays. However, instead of using a regular list, you need to
 * implement your solution using tuples.
 *
 * Your task is to complete the function below, which takes in two arrays (implemented as tuples) as arguments.
 * The function should return a new tuple that contains the common elements between the two input arrays.
 *
 * Example:
 * arr1 = listOf(1, 2, 3, 4, 5)
 * arr2 = listOf(4, 5, 6, 7, 8)
 *
 * Output:
 * (4, 5)
 */
fun findCommonElements(arr1: List<Int>, arr2: List<Int>): List<Int> {

    val commonElements = arr1.toSet() intersect arr2.toSet()
    return commonElements.toList()
}