Using Set to get unique elements:

Shortened version: