/**
 * This exercise requires you to find the common exercises performed by two patients.
 *
 * @param patient1 A dictionary representing the exercises performed by patient 1, where the keys are exercise names
 *                 and the values are the duration in minutes.
 * @param patient2 A dictionary representing the exercises performed by patient 2, where the keys are exercise names
 *                 and the values are the duration in minutes.
 * @return A list of exercise names that are performed by both patients.
 */
fun findCommonExercises(patient1: Map<String, Int>, patient2: Map<String, Int>): List<String> {

    val commonExercises = mutableListOf<String>()

    // Iterate over each exercise in patient1's exercises
    for (exercise in patient1.keys) {
        // Check if the exercise is also present in patient2's exercises
        if (exercise in patient2.keys) {
            // Add the exercise to the list of common exercises
            commonExercises.add(exercise)
        }
    }

    return commonExercises
}
/**
 * This exercise requires you to find the common exercises performed by two patients.
 *
 * @param patient1 A dictionary representing the exercises performed by patient 1, where the keys are exercise names
 *                 and the values are the duration in minutes.
 * @param patient2 A dictionary representing the exercises performed by patient 2, where the keys are exercise names
 *                 and the values are the duration in minutes.
 * @return A list of exercise names that are performed by both patients.
 */
fun findCommonExercises(patient1: Map<String, Int>, patient2: Map<String, Int>): List<String> {
/**
 * This exercise requires you to find the common exercises performed by two patients.
 *
 * @param patient1 A dictionary representing the exercises performed by patient 1, where the keys are exercise names
 *                 and the values are the duration in minutes.
 * @param patient2 A dictionary representing the exercises performed by patient 2, where the keys are exercise names
 *                 and the values are the duration in minutes.
 * @return A list of exercise names that are performed by both patients.
 */
fun findCommonExercises(patient1: Map<String, Int>, patient2: Map<String, Int>): List<String> {

    val commonExercises = mutableListOf<String>()

    // Iterate over each exercise in patient1's exercises
    for (exercise in patient1.keys) {
        // Check if the exercise is also present in patient2's exercises
        if (exercise in patient2.keys) {
            // Add the exercise to the list of common exercises
            commonExercises.add(exercise)
        }
    }

    return commonExercises
}