Implement Modified Intersection
Asked at Meta · Coding & Leetcode-style Questions · Difficulty: Easy
Write a function that takes two integer arrays as input and returns their union instead of the intersection. Test cases include: [1, 2, 3], [2, 3, 4] should return [1, 2, 3, 4]; [5, 6], [5, 6] should return [5, 6]. Note: The elements in the result array must be unique, and they can be returned in any order. The length of each input array will not exceed 1000.
Loading the problem…
More Meta interview questions
- LLM conceptual questions
- Implement a Two-Hidden-Layer MLP with Backpropagation in NumPy
- Dot Product with Run-Length Encoded Vectors
- Count Lakes Wrapped by a Given Island
- Minimum Remove to Make Valid Parentheses
- LLM with Beam Search and Nucleus Sampling (Meta MSL)