/**
 * Given a list of patient records and an injury site, return the total number of patients who have
 * visited the physical therapist for that specific injury site.
 *
 * @param patientRecords A list of patient records, where each record is a Pair containing the patient's name
 * and their injury site as a string.
 * @param injurySite The specific injury site of interest.
 * @return The total number of patients having the given injury site.
 *
 * Example:
 * performExercise(listOf(Pair("John", "Knee"), Pair("Alice", "Back"), Pair("Bob", "Knee"), Pair("Charlie", "Shoulder")), "Knee")
 * Output: 2
 */
fun performExercise(patientRecords: List<Pair<String, String>>, injurySite: String): Int {

    // Use filter to get the patient records where the injury site matches the given injurySite
    val matchingPatients = patientRecords.filter { it.second == injurySite }

    // Return the number of matching patients by returning the size of the matchingPatients list
    return matchingPatients.size
}
/**
 * Given a list of patient records and an injury site, return the total number of patients who have
 * visited the physical therapist for that specific injury site.
 *
 * @param patientRecords A list of patient records, where each record is a Pair containing the patient's name
 * and their injury site as a string.
 * @param injurySite The specific injury site of interest.
 * @return The total number of patients having the given injury site.
 *
 * Example:
 * performExercise(listOf(Pair("John", "Knee"), Pair("Alice", "Back"), Pair("Bob", "Knee"), Pair("Charlie", "Shoulder")), "Knee")
 * Output: 2
 */
fun performExercise(patientRecords: List<Pair<String, String>>, injurySite: String): Int {
/**
 * Given a list of patient records and an injury site, return the total number of patients who have
 * visited the physical therapist for that specific injury site.
 *
 * @param patientRecords A list of patient records, where each record is a Pair containing the patient's name
 * and their injury site as a string.
 * @param injurySite The specific injury site of interest.
 * @return The total number of patients having the given injury site.
 *
 * Example:
 * performExercise(listOf(Pair("John", "Knee"), Pair("Alice", "Back"), Pair("Bob", "Knee"), Pair("Charlie", "Shoulder")), "Knee")
 * Output: 2
 */
fun performExercise(patientRecords: List<Pair<String, String>>, injurySite: String): Int {

    // Use filter to get the patient records where the injury site matches the given injurySite
    val matchingPatients = patientRecords.filter { it.second == injurySite }

    // Return the number of matching patients by returning the size of the matchingPatients list
    return matchingPatients.size
}