Sobes.tech
Junior — Senior

Get elements unique to each of the two arrays

livecode

Task condition

Given two numeric arrays arrA and arrB. You need to return an array result, consisting of two nested arrays:

result[0] – numbers from arrA that are not in arrB; result[1] – numbers from arrB that are not in arrA.

Examples: Input: arrA = [1,2,3], arrB = [2,4,6] Output: [[1,3],[4,6]]

Input: arrA = [1,2,3,3], arrB = [1,1,2,2] Output: [[3], []]