/**
 * This function takes in a list of athlete data and returns the maximum distance covered by any athlete.
 * The athlete data is represented as a list of dictionaries, where each dictionary contains the name of the athlete and their distance covered in meters.
 *
 * @param athleteData a list of dictionaries representing athlete data
 * @return maxDistance maximum distance covered by any athlete
 */
fun findMaxDistance(athleteData: List<Map<String, Any>>): Int {

    var maxDistance = 0

    try {
        // Iterate through each athlete dictionary in the athlete data
        for (athlete in athleteData) {
            try {
                // Check if the distance value exists for the current athlete
                if (athlete.containsKey("distance")) {
                    // Compare the distance value with the current maximum distance
                    val distance = athlete["distance"] as? Int
                    if (distance != null && distance > maxDistance) {
                        maxDistance = distance
                    }
                }
            } catch (e: Exception) {
                // Ignore any exceptions raised within this nested try-catch block
            }
        }
    } catch (e: Exception) {
        // Ignore any exceptions raised within this outer try-catch block
    }

    return maxDistance
}
/**
 * This function takes in a list of athlete data and returns the maximum distance covered by any athlete.
 * The athlete data is represented as a list of dictionaries, where each dictionary contains the name of the athlete and their distance covered in meters.
 *
 * @param athleteData a list of dictionaries representing athlete data
 * @return maxDistance maximum distance covered by any athlete
 */
fun findMaxDistance(athleteData: List<Map<String, Any>>): Int {
/**
 * This function takes in a list of athlete data and returns the maximum distance covered by any athlete.
 * The athlete data is represented as a list of dictionaries, where each dictionary contains the name of the athlete and their distance covered in meters.
 *
 * @param athleteData a list of dictionaries representing athlete data
 * @return maxDistance maximum distance covered by any athlete
 */
fun findMaxDistance(athleteData: List<Map<String, Any>>): Int {

    var maxDistance = 0

    try {
        // Iterate through each athlete dictionary in the athlete data
        for (athlete in athleteData) {
            try {
                // Check if the distance value exists for the current athlete
                if (athlete.containsKey("distance")) {
                    // Compare the distance value with the current maximum distance
                    val distance = athlete["distance"] as? Int
                    if (distance != null && distance > maxDistance) {
                        maxDistance = distance
                    }
                }
            } catch (e: Exception) {
                // Ignore any exceptions raised within this nested try-catch block
            }
        }
    } catch (e: Exception) {
        // Ignore any exceptions raised within this outer try-catch block
    }

    return maxDistance
}