Back to exercises

Intersection of Two Arrays

Convert both arrays to sets, intersect them, and sort the result if you want deterministic output for testing or interviews.

Coding Exercises Easy O(n + m)

Intersection of Two Arrays

Convert both arrays to sets, intersect them, and sort the result if you want deterministic output for testing or interviews.

Return the unique values that appear in both arrays.