🚀 Golang fastest and clean solution (17ms, beats 100% by runtime)
Instead of map we can use an array in this problem because the range of possible values is very small [-1000, 1000]. Since we can\'t use negative numbers as arr
Instead of `map` we can use an array in this problem because the range of possible values is very small `[-1000, 1000]`. Since we can\'t use negative numbers as array indexes, we\'ll just add 1000 to each number, so we have an index range of `[0, 2000]`.\n\nOtherwise, the logic is simple, we write to the dictionary array what numbers are in one set, and from the second set we select only those that are not in the dictionary array. This logic is implemented in the `setDifference` function, which essentially finds the set difference `A - B`.\n```go\nfunc setDifference(a, b []int) []int {\n    d := [2001]bool{}\n    ans := []int{}\n    for _, x := range b {\n        d[x + 1000] = true\n    }\n    for _, x := range a {\n        if !d[x + 1000] {\n            ans = append(ans, x)\n            d[x + 1000] = true // prevent duplicates from being added\n        }\n    }\n    return ans\n}\n\nfunc findDifference(nums1 []int, nums2 []int) [][]int {\n    return [][]int{ setDifference(nums1, nums2), setDifference(nums2, nums1) }\n}\n```\nThe time complexity of this solution is O(n + m).
['Go']