/**
 * A police officer wants to delete certain criminals from a list of known criminals. The officer knows that the index of a criminal represents the severity of their crime, where a lower index indicates a more severe crime. However, the officer only wants to delete the criminals who have committed severe crimes and are above a certain age.
 *
 * @param office The name of the police officer.
 * @param criminals A list of maps, where each map represents a criminal and contains their information like name, age, and crime severity.
 * @return A new list of criminals after deleting the ones who meet the specified criteria.
 */
fun deleteCriminals(office: String, criminals: MutableList<Map<String, Any>>): MutableList<Map<String, Any>> {

    // Selecting the criminals with severe crimes and above certain age
    val criminalsToDelete = criminals.filter { it["severity"] as Int >= 8 && it["age"] as Int >= 30 }

    // Deleting the selected criminals from the list
    criminals.removeAll(criminalsToDelete)

    return criminals
}
/**
 * A police officer wants to delete certain criminals from a list of known criminals. The officer knows that the index of a criminal represents the severity of their crime, where a lower index indicates a more severe crime. However, the officer only wants to delete the criminals who have committed severe crimes and are above a certain age.
 *
 * @param office The name of the police officer.
 * @param criminals A list of maps, where each map represents a criminal and contains their information like name, age, and crime severity.
 * @return A new list of criminals after deleting the ones who meet the specified criteria.
 */
fun deleteCriminals(office: String, criminals: MutableList<Map<String, Any>>): MutableList<Map<String, Any>> {
/**
 * A police officer wants to delete certain criminals from a list of known criminals. The officer knows that the index of a criminal represents the severity of their crime, where a lower index indicates a more severe crime. However, the officer only wants to delete the criminals who have committed severe crimes and are above a certain age.
 *
 * @param office The name of the police officer.
 * @param criminals A list of maps, where each map represents a criminal and contains their information like name, age, and crime severity.
 * @return A new list of criminals after deleting the ones who meet the specified criteria.
 */
fun deleteCriminals(office: String, criminals: MutableList<Map<String, Any>>): MutableList<Map<String, Any>> {

    // Selecting the criminals with severe crimes and above certain age
    val criminalsToDelete = criminals.filter { it["severity"] as Int >= 8 && it["age"] as Int >= 30 }

    // Deleting the selected criminals from the list
    criminals.removeAll(criminalsToDelete)

    return criminals
}