/**
 * This function takes in two arrays of positive integers and returns a new array containing the unique intersection
 * of the two arrays.
 *
 * @param arr1 The first array of positive integers.
 * @param arr2 The second array of positive integers.
 * @return A new array containing the unique intersection of arr1 and arr2.
 *
 * Example:
 * uniqueIntersection(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) => [3, 4]
 * uniqueIntersection(listOf(9, 8, 7), listOf(9, 8, 7)) => [9, 8, 7]
 * uniqueIntersection(listOf(1, 2, 3), listOf(4, 5, 6)) => []
 */
fun uniqueIntersection(arr1: List<Int>, arr2: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()

    for (num in arr1) {
        if (num in arr2 && num !in intersection) {
            intersection.add(num)
        }
    }

    return intersection
}
/**
 * This function takes in two arrays of positive integers and returns a new array containing the unique intersection
 * of the two arrays.
 *
 * @param arr1 The first array of positive integers.
 * @param arr2 The second array of positive integers.
 * @return A new array containing the unique intersection of arr1 and arr2.
 *
 * Example:
 * uniqueIntersection(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) => [3, 4]
 * uniqueIntersection(listOf(9, 8, 7), listOf(9, 8, 7)) => [9, 8, 7]
 * uniqueIntersection(listOf(1, 2, 3), listOf(4, 5, 6)) => []
 */
fun uniqueIntersection(arr1: List<Int>, arr2: List<Int>): List<Int> {
/**
 * This function takes in two arrays of positive integers and returns a new array containing the unique intersection
 * of the two arrays.
 *
 * @param arr1 The first array of positive integers.
 * @param arr2 The second array of positive integers.
 * @return A new array containing the unique intersection of arr1 and arr2.
 *
 * Example:
 * uniqueIntersection(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) => [3, 4]
 * uniqueIntersection(listOf(9, 8, 7), listOf(9, 8, 7)) => [9, 8, 7]
 * uniqueIntersection(listOf(1, 2, 3), listOf(4, 5, 6)) => []
 */
fun uniqueIntersection(arr1: List<Int>, arr2: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()

    for (num in arr1) {
        if (num in arr2 && num !in intersection) {
            intersection.add(num)
        }
    }

    return intersection
}