/**
 * This function takes a police report and finds the suspect's name.
 * The police report is a list of nested dictionaries, where each dictionary represents a person's information.
 * The suspect is the person with the highest negative index value in the report.
 * Find the suspect's name and return it.
 *
 * @param policeReport A list of nested dictionaries containing information about people.
 * @return The name of the suspect.
 */
fun findSuspect(policeReport: List<Map<String, Any>>): String? {

    var suspect: String? = null
    var maxIndex = Int.MIN_VALUE

    for (person in policeReport) {
        val name = person["name"] as String?
        val index = person["index"] as Int?

        // Nested ternary operator to determine the suspect based on negative index
        if (index != null && index < 0) {
            suspect = name
        }

        // Update the maximum negative index value
        if (index != null && index < 0 && index > maxIndex) {
            maxIndex = index
        }
    }

    return suspect
}
/**
 * This function takes a police report and finds the suspect's name.
 * The police report is a list of nested dictionaries, where each dictionary represents a person's information.
 * The suspect is the person with the highest negative index value in the report.
 * Find the suspect's name and return it.
 *
 * @param policeReport A list of nested dictionaries containing information about people.
 * @return The name of the suspect.
 */
fun findSuspect(policeReport: List<Map<String, Any>>): String? {
/**
 * This function takes a police report and finds the suspect's name.
 * The police report is a list of nested dictionaries, where each dictionary represents a person's information.
 * The suspect is the person with the highest negative index value in the report.
 * Find the suspect's name and return it.
 *
 * @param policeReport A list of nested dictionaries containing information about people.
 * @return The name of the suspect.
 */
fun findSuspect(policeReport: List<Map<String, Any>>): String? {

    var suspect: String? = null
    var maxIndex = Int.MIN_VALUE

    for (person in policeReport) {
        val name = person["name"] as String?
        val index = person["index"] as Int?

        // Nested ternary operator to determine the suspect based on negative index
        if (index != null && index < 0) {
            suspect = name
        }

        // Update the maximum negative index value
        if (index != null && index < 0 && index > maxIndex) {
            maxIndex = index
        }
    }

    return suspect
}