/**
 * As a Physical Therapist, you have a patient who needs to perform a specific number of repetitions for each set of exercises. Write a function that counts the total number of repetitions completed by the patient.
 *
 * @param reps A list of integers representing the number of repetitions for each set.
 * @param sets The total number of sets.
 * @return The total number of repetitions completed.
 *
 * Example:
 * countReps(listOf(10, 5, 8, 6), 4) returns 29
 */
fun countReps(reps: List<Int>, sets: Int): Int {

    var totalReps = 0

    for (numReps in reps) {
        for (rep in 0 until numReps) {
            totalReps++
        }
    }

    return totalReps
}
/**
 * As a Physical Therapist, you have a patient who needs to perform a specific number of repetitions for each set of exercises. Write a function that counts the total number of repetitions completed by the patient.
 *
 * @param reps A list of integers representing the number of repetitions for each set.
 * @param sets The total number of sets.
 * @return The total number of repetitions completed.
 *
 * Example:
 * countReps(listOf(10, 5, 8, 6), 4) returns 29
 */
fun countReps(reps: List<Int>, sets: Int): Int {
/**
 * As a Physical Therapist, you have a patient who needs to perform a specific number of repetitions for each set of exercises. Write a function that counts the total number of repetitions completed by the patient.
 *
 * @param reps A list of integers representing the number of repetitions for each set.
 * @param sets The total number of sets.
 * @return The total number of repetitions completed.
 *
 * Example:
 * countReps(listOf(10, 5, 8, 6), 4) returns 29
 */
fun countReps(reps: List<Int>, sets: Int): Int {

    var totalReps = 0

    for (numReps in reps) {
        for (rep in 0 until numReps) {
            totalReps++
        }
    }

    return totalReps
}