Staff the Joint Project

Intermediate

Two teams each maintain a list of skills. To staff a joint project you need the skills that BOTH teams have in common.

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

Examples

Inputa = {apex, flow, lwc, soql}, b = {lwc, soql, aura}
Output{lwc, soql}
Inputa = {x, y}, b = {z}
Output{}
Hints
  • Copy one set, then retainAll() the other.
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.