/**
 * This function allows a lawyer to update the status of a legal case in a list.
 *
 * @param caseList The list containing all the legal cases.
 * @param caseNumber The number of the case to be updated.
 * @param newStatus The new status to be assigned to the case.
 * @return The updated case list.
 */
fun updateLegalCase(caseList: MutableList<String>, caseNumber: Int, newStatus: String): List<String> {

    try {
        caseList[caseNumber] = newStatus
        return caseList
    } catch (e: IndexOutOfBoundsException) {
        return listOf("Case number not found in the list.")
    }
}
/**
 * This function allows a lawyer to update the status of a legal case in a list.
 *
 * @param caseList The list containing all the legal cases.
 * @param caseNumber The number of the case to be updated.
 * @param newStatus The new status to be assigned to the case.
 * @return The updated case list.
 */
fun updateLegalCase(caseList: MutableList<String>, caseNumber: Int, newStatus: String): List<String> {
/**
 * This function allows a lawyer to update the status of a legal case in a list.
 *
 * @param caseList The list containing all the legal cases.
 * @param caseNumber The number of the case to be updated.
 * @param newStatus The new status to be assigned to the case.
 * @return The updated case list.
 */
fun updateLegalCase(caseList: MutableList<String>, caseNumber: Int, newStatus: String): List<String> {

    try {
        caseList[caseNumber] = newStatus
        return caseList
    } catch (e: IndexOutOfBoundsException) {
        return listOf("Case number not found in the list.")
    }
}