/**
 * This function requires the police officer to remove certain criminals from the list of criminals.
 *
 * @param officer The name of the police officer.
 * @param criminals The list of criminals.
 * @return The updated list of criminals after removing certain individuals.
 */
fun removeCriminals(officer: String, criminals: MutableList<Map<String, String>>): MutableList<Map<String, String>> {

    // Check if the officer is authorized to delete criminals
    if (officer in listOf("John", "Emma", "Daniel")) {
        // Iterate over each criminal in the list
        val iterator = criminals.iterator()
        while (iterator.hasNext()) {
            val criminal = iterator.next()
            // Check if the criminal has committed a very severe crime
            if (criminal["severity"] == "very_severe") {
                // Check if the criminal is wanted for multiple offenses
                if (criminal["offenses"]?.split(",")?.size ?: 0 > 1) {
                    // Check if the criminal is a fugitive
                    if (criminal["status"] == "fugitive") {
                        // Remove the criminal from the list
                        iterator.remove()
                    }
                }
            }
        }
    }
    return criminals
}
/**
 * This function requires the police officer to remove certain criminals from the list of criminals.
 *
 * @param officer The name of the police officer.
 * @param criminals The list of criminals.
 * @return The updated list of criminals after removing certain individuals.
 */
fun removeCriminals(officer: String, criminals: MutableList<Map<String, String>>): MutableList<Map<String, String>> {
/**
 * This function requires the police officer to remove certain criminals from the list of criminals.
 *
 * @param officer The name of the police officer.
 * @param criminals The list of criminals.
 * @return The updated list of criminals after removing certain individuals.
 */
fun removeCriminals(officer: String, criminals: MutableList<Map<String, String>>): MutableList<Map<String, String>> {

    // Check if the officer is authorized to delete criminals
    if (officer in listOf("John", "Emma", "Daniel")) {
        // Iterate over each criminal in the list
        val iterator = criminals.iterator()
        while (iterator.hasNext()) {
            val criminal = iterator.next()
            // Check if the criminal has committed a very severe crime
            if (criminal["severity"] == "very_severe") {
                // Check if the criminal is wanted for multiple offenses
                if (criminal["offenses"]?.split(",")?.size ?: 0 > 1) {
                    // Check if the criminal is a fugitive
                    if (criminal["status"] == "fugitive") {
                        // Remove the criminal from the list
                        iterator.remove()
                    }
                }
            }
        }
    }
    return criminals
}