Identify a Suspect
There was a theft of research hardware on campus last night. Based on eyewitness accounts, they figured out the suspect went through the Siebel Center for Computer Science, the Digital Computing Laboratory, and the Illini Union. Luckily, you have the lists of the people who entered each building from their I-Card ID swipes.
You've been given three non-null
Set<String>
s that represent the lists of people that entered each building
yesterday.
Your job is to create a function called calculateSuspects
that when given these parameters returns the list of
suspects as a Set<String>
.
This list should consist of all the names of all people who are included in at least two of the Set
s.
You may find reading the documentation of addAll
(union) and retainAll
(intersection) helpful.
You may assume that no inputs will be null
, however, given Set
s may be empty.
Readings:
- How a professor uses student-ID card data to help predict dropouts (AZ Central): A University of Arizona researcher is using card swipe data to better understand why dropouts happen, and is raising privacy concerns in the process. (5 minute read)
Note that you do not need to import
Set
or HashSet
, since they are already available.