/**
 * Given a dictionary of criminal records and an empty set of criminals,
 * iterate over the dictionary and add the criminals' names to the set.
 * However, only add the names of criminals who have committed more than
 * one crime. Return the final set of criminals.
 */
fun arrestCriminals(criminalRecords: Map<String, List<String>>, criminalsSet: MutableSet<String>): Set<String> {

    for ((criminal, records) in criminalRecords) {
        if (records.size > 1) {
            criminalsSet.add(criminal)
        }
    }
    return criminalsSet
}

val criminalRecords = mapOf(
    "John Doe" to listOf("Robbery", "Assault", "Burglary"),
    "Jane Smith" to listOf("Theft"),
    "David Johnson" to listOf("Arson", "Vandalism"),
    "Michael Brown" to listOf("Assault", "Forgery"),
    "Amy Wilson" to listOf("Robbery", "Burglary", "Fraud"),
    "Daniel Davis" to listOf("Drug trafficking"),
    "Jessica Miller" to listOf("Identity theft", "Robbery"),
    "Christopher Martin" to listOf("Drug trafficking"),
    "Sarah Clark" to listOf("Forgery", "Assault"),
    "Brian Anderson" to listOf("Burglary", "Theft")
)

val criminals = mutableSetOf<String>()
/**
 * Given a dictionary of criminal records and an empty set of criminals,
 * iterate over the dictionary and add the criminals' names to the set.
 * However, only add the names of criminals who have committed more than
 * one crime. Return the final set of criminals.
 */
fun arrestCriminals(criminalRecords: Map<String, List<String>>, criminalsSet: MutableSet<String>): Set<String> {
/**
 * Given a dictionary of criminal records and an empty set of criminals,
 * iterate over the dictionary and add the criminals' names to the set.
 * However, only add the names of criminals who have committed more than
 * one crime. Return the final set of criminals.
 */
fun arrestCriminals(criminalRecords: Map<String, List<String>>, criminalsSet: MutableSet<String>): Set<String> {

    for ((criminal, records) in criminalRecords) {
        if (records.size > 1) {
            criminalsSet.add(criminal)
        }
    }
    return criminalsSet
}

val criminalRecords = mapOf(
    "John Doe" to listOf("Robbery", "Assault", "Burglary"),
    "Jane Smith" to listOf("Theft"),
    "David Johnson" to listOf("Arson", "Vandalism"),
    "Michael Brown" to listOf("Assault", "Forgery"),
    "Amy Wilson" to listOf("Robbery", "Burglary", "Fraud"),
    "Daniel Davis" to listOf("Drug trafficking"),
    "Jessica Miller" to listOf("Identity theft", "Robbery"),
    "Christopher Martin" to listOf("Drug trafficking"),
    "Sarah Clark" to listOf("Forgery", "Assault"),
    "Brian Anderson" to listOf("Burglary", "Theft")
)

val criminals = mutableSetOf<String>()