/**
 * Find the names of suspects that were spotted at least twice in the sightings list.
 *
 * @param suspects a list of suspects' names (strings)
 * @param sightings a list of sightings, where each sighting is a pair containing the suspect name and the location
 * @return a list of suspect names that were spotted at least twice
 */
fun findSuspectNames(suspects: List<String>, sightings: List<Pair<String, String>>): List<String> {

    // Use filter and count to find the names of suspects spotted at least twice
    val duplicateSuspects = suspects.filter { suspect ->
        sightings.count { it.first == suspect } >= 2
    }

    return duplicateSuspects
}
/**
 * Find the names of suspects that were spotted at least twice in the sightings list.
 *
 * @param suspects a list of suspects' names (strings)
 * @param sightings a list of sightings, where each sighting is a pair containing the suspect name and the location
 * @return a list of suspect names that were spotted at least twice
 */
fun findSuspectNames(suspects: List<String>, sightings: List<Pair<String, String>>): List<String> {
/**
 * Find the names of suspects that were spotted at least twice in the sightings list.
 *
 * @param suspects a list of suspects' names (strings)
 * @param sightings a list of sightings, where each sighting is a pair containing the suspect name and the location
 * @return a list of suspect names that were spotted at least twice
 */
fun findSuspectNames(suspects: List<String>, sightings: List<Pair<String, String>>): List<String> {

    // Use filter and count to find the names of suspects spotted at least twice
    val duplicateSuspects = suspects.filter { suspect ->
        sightings.count { it.first == suspect } >= 2
    }

    return duplicateSuspects
}