Solution Review: Check if Arrays are Disjoint
Learn a detailed analysis of the different ways to solve the "Check if Arrays are Disjoint" challenge.
We'll cover the following...
We'll cover the following...
Solution: Use a HashSet
There is nothing tricky going on here. The problem is similar to the previous one. All you have to do is create a hash table for arr1 and as soon as you find any value from arr2 in the hash table, you can conclude that the two arrays are not disjoint.
Time complexity
For a lookup array with ...