/**
 * Calculates the duration of an exercise routine based on intensity levels.
 *
 * @param exercises A map containing exercises and their corresponding duration in minutes.
 * @param intensity A value between 0.0 and 1.0 indicating the exercise intensity level.
 * @return The total duration of the exercise routine in minutes.
 */
fun calculateExerciseDuration(exercises: Map<String, Int>, intensity: Double): Double {

    var totalDuration = 0.0
    for ((exercise, duration) in exercises) {
        when {
            intensity < 0.5 && exercise.contains("low") -> totalDuration += duration
            intensity > 0.7 && exercise.contains("high") -> totalDuration += duration
            else -> totalDuration += duration
        }
    }
    return totalDuration
}

// Exercise map with exercise name as key and duration in minutes as value
val exercises = mapOf(
    "low_intensity_walking" to 30,
    "high_intensity_jumping_jacks" to 15,
    "high_intensity_squat_jumps" to 20,
    "medium_intensity_cycling" to 45,
    "low_intensity_stretching" to 10,
    "medium_intensity_swimming" to 60
)
/**
 * Calculates the duration of an exercise routine based on intensity levels.
 *
 * @param exercises A map containing exercises and their corresponding duration in minutes.
 * @param intensity A value between 0.0 and 1.0 indicating the exercise intensity level.
 * @return The total duration of the exercise routine in minutes.
 */
fun calculateExerciseDuration(exercises: Map<String, Int>, intensity: Double): Double {
/**
 * Calculates the duration of an exercise routine based on intensity levels.
 *
 * @param exercises A map containing exercises and their corresponding duration in minutes.
 * @param intensity A value between 0.0 and 1.0 indicating the exercise intensity level.
 * @return The total duration of the exercise routine in minutes.
 */
fun calculateExerciseDuration(exercises: Map<String, Int>, intensity: Double): Double {

    var totalDuration = 0.0
    for ((exercise, duration) in exercises) {
        when {
            intensity < 0.5 && exercise.contains("low") -> totalDuration += duration
            intensity > 0.7 && exercise.contains("high") -> totalDuration += duration
            else -> totalDuration += duration
        }
    }
    return totalDuration
}

// Exercise map with exercise name as key and duration in minutes as value
val exercises = mapOf(
    "low_intensity_walking" to 30,
    "high_intensity_jumping_jacks" to 15,
    "high_intensity_squat_jumps" to 20,
    "medium_intensity_cycling" to 45,
    "low_intensity_stretching" to 10,
    "medium_intensity_swimming" to 60
)