You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Write a function, intersection, that takes in two arrays, a,b, as arguments. The function should return a new array containing elements that are in both of the two arrays.
// You may assume that each input array does not contain duplicate elements.
// Input: Two arrays
// Output: An array with elements that are in both arrays
// Strategy:
// Iterate through one array and store each element (since each array is unique we can use a set)
// Iterate through the second string and check if the object contains the current element