Size the Combined Audience

Basic

Two campaigns each reached an audience. Marketing wants the size of the combined, de-duplicated audience — anyone reached by either campaign, counted once.

Implement `solve(Set<String> a, Set<String> b)` to return the number of distinct elements across both sets (the size of their union).

Examples

Inputa = {x, y}, b = {y, z}
Output3
Inputa = {a}, b = {a}
Output1
Hints
  • Copy one set, addAll the other, then read size().
Anonymous Apex

Your code runs in a secure sandbox against multiple hidden test cases. The problem is solved only when every test passes. Each run is isolated and any data changes are rolled back automatically.