/**
 * This exercise aims to test your skills in both identity comparison and accessing elements of a list.
 *
 * Given a list of patients and a specific patient name, write a function that returns the index of the patient in the list
 * using identity comparison. If the patient is not found, return -1.
 *
 * @param patientList A list of patient names (strings).
 * @param patientName The name of the patient to search for.
 * @return The index at which the patient is found in the list, or -1 if not found.
 */
fun findPatientExercise(patientList: List<String>, patientName: String): Int {

    var index = -1  // Initialize index with -1 indicating patient not found
    for ((i, patient) in patientList.withIndex()) {
        if (patient === patientName) {  // Identity comparison using '==='
            index = i
            break
        }
    }
    return index
}
/**
 * This exercise aims to test your skills in both identity comparison and accessing elements of a list.
 *
 * Given a list of patients and a specific patient name, write a function that returns the index of the patient in the list
 * using identity comparison. If the patient is not found, return -1.
 *
 * @param patientList A list of patient names (strings).
 * @param patientName The name of the patient to search for.
 * @return The index at which the patient is found in the list, or -1 if not found.
 */
fun findPatientExercise(patientList: List<String>, patientName: String): Int {
/**
 * This exercise aims to test your skills in both identity comparison and accessing elements of a list.
 *
 * Given a list of patients and a specific patient name, write a function that returns the index of the patient in the list
 * using identity comparison. If the patient is not found, return -1.
 *
 * @param patientList A list of patient names (strings).
 * @param patientName The name of the patient to search for.
 * @return The index at which the patient is found in the list, or -1 if not found.
 */
fun findPatientExercise(patientList: List<String>, patientName: String): Int {

    var index = -1  // Initialize index with -1 indicating patient not found
    for ((i, patient) in patientList.withIndex()) {
        if (patient === patientName) {  // Identity comparison using '==='
            index = i
            break
        }
    }
    return index
}