Back to exercises

Union of Two Arrays

Convert both arrays to sets, take the union, and sort the result if stable output is helpful.

Coding Exercises Easy O(n + m)

Union of Two Arrays

Convert both arrays to sets, take the union, and sort the result if stable output is helpful.

Return the unique values that appear in either array.