HashMap & Set

Find Common Elements

easy
Given two arrays `a` and `b`, return an array of unique values that appear in both, in any order. Example: `commonElements([1,2,2,3], [2,3,4])` → `[2,3]` (order may vary).
Hint steps(0/3 revealed)
  1. 1

    Complete previous step or reveal to unlock this hint.

  2. 2

    Complete previous step or reveal to unlock this hint.

  3. 3

    Complete previous step or reveal to unlock this hint.