By Long Luo

# Intuition

We can use $\texttt{HashSet}$ to record the distinct integers of the two arrays and judge whether a distinct integer in $\textit{nums}_1$ which not present in $\textit{nums}_2$.

We can only use $2$ $\texttt{HashSet}$, not $4$ $\texttt{HashSet}$.

## Analysis

• Time Complexity: $O(m+n)$.
• Space Complexity: $O(m+n)$.

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. 😉😃💗