/**
 * This function takes two arrays as inputs and returns the intersection of the arrays.
 *
 * The intersection of two arrays is a new array that contains only the common elements of the original arrays.
 *
 * @param arr1 The first array.
 * @param arr2 The second array.
 * @return The intersection of the arrays.
 */
fun findArrayIntersection(arr1: List<Int>, arr2: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()
    
    // Convert arrays to sets for efficient intersection operation
    val set1 = arr1.toSet()
    val set2 = arr2.toSet()
    
    // Find the common elements by taking intersection
    intersection.addAll(set1.intersect(set2))
    
    return intersection
}
/**
 * This function takes two arrays as inputs and returns the intersection of the arrays.
 *
 * The intersection of two arrays is a new array that contains only the common elements of the original arrays.
 *
 * @param arr1 The first array.
 * @param arr2 The second array.
 * @return The intersection of the arrays.
 */
fun findArrayIntersection(arr1: List<Int>, arr2: List<Int>): List<Int> {
/**
 * This function takes two arrays as inputs and returns the intersection of the arrays.
 *
 * The intersection of two arrays is a new array that contains only the common elements of the original arrays.
 *
 * @param arr1 The first array.
 * @param arr2 The second array.
 * @return The intersection of the arrays.
 */
fun findArrayIntersection(arr1: List<Int>, arr2: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()
    
    // Convert arrays to sets for efficient intersection operation
    val set1 = arr1.toSet()
    val set2 = arr2.toSet()
    
    // Find the common elements by taking intersection
    intersection.addAll(set1.intersect(set2))
    
    return intersection
}