python_o[n]_hashtable
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution(object):\n    def findDifference(self, nums1, nums2):\n        hashtable = {}\n        first_true_second_false = []\n        second_true_first_false = []\n        for num in nums1:\n            if num not in hashtable:\n                hashtable[num] = [True,False]\n        for num in nums2:\n            if num in hashtable:\n                hashtable[num][1] = True\n            else:\n                hashtable[num] = [False,True]\n        for key, value in hashtable.items():\n            if value[0] and not value[1]:\n                first_true_second_false.append(key)\n            elif not value[0] and value[1]:\n                second_true_first_false.append(key)\n        return [first_true_second_false,second_true_first_false]\n        \n        \n        """\n        :type nums1: List[int]\n        :type nums2: List[int]\n        :rtype: List[List[int]]\n        """\n        \n```
['Python']