/**
 * Modify the status of each patient in the patientList based on their current status.
 *
 * @param patientList A list containing the patients and their current status.
 * @param status The new status to be assigned to each patient.
 * @return The updated patientList with the modified status for each patient.
 *
 * Example:
 * patientList = listOf(listOf("John", "Injured"), listOf("Anna", "Healthy"), listOf("Mark", "Recovering"))
 * status = "Improved"
 * modifyPatientStatus(patientList, status) returns listOf(listOf("John", "Improved"), listOf("Anna", "Improved"), listOf("Mark", "Recovering"))
 */
fun modifyPatientStatus(patientList: List<List<String>>, status: String): List<List<String>> {

    return patientList.map { (name, currentStatus) ->
        when (currentStatus) {
            "Injured", "Healthy" -> listOf(name, status)
            else -> listOf(name, currentStatus)
        }
    }
}
/**
 * Modify the status of each patient in the patientList based on their current status.
 *
 * @param patientList A list containing the patients and their current status.
 * @param status The new status to be assigned to each patient.
 * @return The updated patientList with the modified status for each patient.
 *
 * Example:
 * patientList = listOf(listOf("John", "Injured"), listOf("Anna", "Healthy"), listOf("Mark", "Recovering"))
 * status = "Improved"
 * modifyPatientStatus(patientList, status) returns listOf(listOf("John", "Improved"), listOf("Anna", "Improved"), listOf("Mark", "Recovering"))
 */
fun modifyPatientStatus(patientList: List<List<String>>, status: String): List<List<String>> {
/**
 * Modify the status of each patient in the patientList based on their current status.
 *
 * @param patientList A list containing the patients and their current status.
 * @param status The new status to be assigned to each patient.
 * @return The updated patientList with the modified status for each patient.
 *
 * Example:
 * patientList = listOf(listOf("John", "Injured"), listOf("Anna", "Healthy"), listOf("Mark", "Recovering"))
 * status = "Improved"
 * modifyPatientStatus(patientList, status) returns listOf(listOf("John", "Improved"), listOf("Anna", "Improved"), listOf("Mark", "Recovering"))
 */
fun modifyPatientStatus(patientList: List<List<String>>, status: String): List<List<String>> {

    return patientList.map { (name, currentStatus) ->
        when (currentStatus) {
            "Injured", "Healthy" -> listOf(name, status)
            else -> listOf(name, currentStatus)
        }
    }
}