/**
 * This exercise aims to remove the injury-prone athletes from a given list of athletes.
 *
 * @param athletes A list of dictionaries representing athletes, where each dictionary contains the athlete's name
 * and injury history.
 * @return A modified list with only the athletes who are not injury-prone.
 */
fun removeInjuryProne(athletes: MutableList<Map<String, Any>>): MutableList<Map<String, Any>> {

    val iterator = athletes.iterator()
    while (iterator.hasNext()) {
        val athlete = iterator.next()
        if (!athlete.containsKey("injury_history")) {
            continue
        }
        if ((athlete["injury_history"] as String).length > 3) {
            iterator.remove()
            break
        }
    }
    return athletes
}
/**
 * This exercise aims to remove the injury-prone athletes from a given list of athletes.
 *
 * @param athletes A list of dictionaries representing athletes, where each dictionary contains the athlete's name
 * and injury history.
 * @return A modified list with only the athletes who are not injury-prone.
 */
fun removeInjuryProne(athletes: MutableList<Map<String, Any>>): MutableList<Map<String, Any>> {
/**
 * This exercise aims to remove the injury-prone athletes from a given list of athletes.
 *
 * @param athletes A list of dictionaries representing athletes, where each dictionary contains the athlete's name
 * and injury history.
 * @return A modified list with only the athletes who are not injury-prone.
 */
fun removeInjuryProne(athletes: MutableList<Map<String, Any>>): MutableList<Map<String, Any>> {

    val iterator = athletes.iterator()
    while (iterator.hasNext()) {
        val athlete = iterator.next()
        if (!athlete.containsKey("injury_history")) {
            continue
        }
        if ((athlete["injury_history"] as String).length > 3) {
            iterator.remove()
            break
        }
    }
    return athletes
}