/**
 * This function calculates the progress of a patient in their rehabilitation sessions based on their goals.
 *
 * @param rehabSessions A dictionary representing the number of completed rehabilitation sessions for different exercises.
 * @param goals A dictionary representing the desired goal for each exercise.
 * @return A dictionary representing the progress made in each exercise, calculated as a percentage.
 *
 * Example:
 * rehabSessions = mapOf("exercise1" to 20, "exercise2" to 15, "exercise3" to 10)
 * goals = mapOf("exercise1" to 100, "exercise2" to 50, "exercise3" to 75)
 * calculateProgress(rehabSessions, goals) => mapOf("exercise1" to 20.0, "exercise2" to 30.0, "exercise3" to 13.3)
 */
fun calculateProgress(rehabSessions: Map<String, Int>, goals: Map<String, Int>): Map<String, Double> {

    val progress = mutableMapOf<String, Double>()
    for ((exercise, sessions) in rehabSessions) {
        if (exercise in goals && goals[exercise]!! > 0) {
            progress[exercise] = (sessions.toDouble() / goals[exercise]!!) * 100
        } else {
            progress[exercise] = 0.0
        }
    }
    return progress
}
/**
 * This function calculates the progress of a patient in their rehabilitation sessions based on their goals.
 *
 * @param rehabSessions A dictionary representing the number of completed rehabilitation sessions for different exercises.
 * @param goals A dictionary representing the desired goal for each exercise.
 * @return A dictionary representing the progress made in each exercise, calculated as a percentage.
 *
 * Example:
 * rehabSessions = mapOf("exercise1" to 20, "exercise2" to 15, "exercise3" to 10)
 * goals = mapOf("exercise1" to 100, "exercise2" to 50, "exercise3" to 75)
 * calculateProgress(rehabSessions, goals) => mapOf("exercise1" to 20.0, "exercise2" to 30.0, "exercise3" to 13.3)
 */
fun calculateProgress(rehabSessions: Map<String, Int>, goals: Map<String, Int>): Map<String, Double> {
/**
 * This function calculates the progress of a patient in their rehabilitation sessions based on their goals.
 *
 * @param rehabSessions A dictionary representing the number of completed rehabilitation sessions for different exercises.
 * @param goals A dictionary representing the desired goal for each exercise.
 * @return A dictionary representing the progress made in each exercise, calculated as a percentage.
 *
 * Example:
 * rehabSessions = mapOf("exercise1" to 20, "exercise2" to 15, "exercise3" to 10)
 * goals = mapOf("exercise1" to 100, "exercise2" to 50, "exercise3" to 75)
 * calculateProgress(rehabSessions, goals) => mapOf("exercise1" to 20.0, "exercise2" to 30.0, "exercise3" to 13.3)
 */
fun calculateProgress(rehabSessions: Map<String, Int>, goals: Map<String, Int>): Map<String, Double> {

    val progress = mutableMapOf<String, Double>()
    for ((exercise, sessions) in rehabSessions) {
        if (exercise in goals && goals[exercise]!! > 0) {
            progress[exercise] = (sessions.toDouble() / goals[exercise]!!) * 100
        } else {
            progress[exercise] = 0.0
        }
    }
    return progress
}