C++ Hash Set
See my latest update in repo LeetCode\n\n## Solution 1. Hash Set \n\ncpp\n// OJ: https://leetcode.com/contest/weekly-contest-286/problems/find-the-difference-of
See my latest update in repo [LeetCode](https://github.com/lzl124631x/LeetCode)\n\n## Solution 1. Hash Set \n\n```cpp\n// OJ: https://leetcode.com/contest/weekly-contest-286/problems/find-the-difference-of-two-arrays/\n// Author: github.com/lzl124631x\n// Time: O(A + B)\n// Space: O(A + B)\nclass Solution {\npublic:\n    vector<vector<int>> findDifference(vector<int>& A, vector<int>& B) {\n        unordered_set<int> sa(begin(A), end(A)), sb(begin(B), end(B));\n        vector<vector<int>> ans(2);\n        for (int n : sa) {\n            if (sb.count(n) == 0) ans[0].push_back(n);\n        }\n        for (int n : sb) {\n            if (sa.count(n) == 0) ans[1].push_back(n);\n        }\n        return ans;\n    }\n};\n```
[]