List the Lapsed Members

Intermediate

Compare last month’s members against this month’s renewals to find who lapsed: the people in the first set but not the second.

Implement `solve(Set<String> a, Set<String> b)` to return a set of the elements in `a` but NOT in `b`.

Examples

Inputa = {a, b, c, d}, b = {b, d}
Output{a, c}
Inputa = {x}, b = {x}
Output{}
Hints
  • Copy a, then removeAll(b).
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.