[LeetCode][2215. Find the Difference of Two Arrays] Java HashSet Solution
By Long Luo
This article is the solution Java HashSet Solution of Problem 2215. Find the Difference of Two Arrays.
Intuition
We can use to record the distinct integers of the two arrays and judge whether a distinct integer in which not present in .
We can only use , not .
1 | public List<List<Integer>> findDifference(int[] nums1, int[] nums2) { |
Analysis
- Time Complexity: .
- Space Complexity: .
All suggestions are welcome.
If you have any query or suggestion please comment below.
Please upvote👍 if you like💗 it. Thank you:-)
Explore More Leetcode Solutions. 😉😃💗