/**
 * Write a function that takes in an integer 'n' and a list of integers 'lst'.
 * The function should return the sum of all numbers in 'lst' that are greater than 'n' using a while loop.
 *
 * Example:
 * greaterThanWhileLoop(5, listOf(4, 8, 3, 2, 9, 6)) -> 23
 *
 * @param n An integer value.
 * @param lst A list of integers.
 * @return The sum of all numbers in 'lst' greater than 'n'.
 */
fun greaterThanWhileLoop(n: Int, lst: List<Int>): Int {

    var totalSum = 0
    var i = 0

    while (i < lst.size) {
        if (lst[i] > n) {
            totalSum += lst[i]
        }
        i++
    }

    return totalSum
}
/**
 * Write a function that takes in an integer 'n' and a list of integers 'lst'.
 * The function should return the sum of all numbers in 'lst' that are greater than 'n' using a while loop.
 *
 * Example:
 * greaterThanWhileLoop(5, listOf(4, 8, 3, 2, 9, 6)) -> 23
 *
 * @param n An integer value.
 * @param lst A list of integers.
 * @return The sum of all numbers in 'lst' greater than 'n'.
 */
fun greaterThanWhileLoop(n: Int, lst: List<Int>): Int {
/**
 * Write a function that takes in an integer 'n' and a list of integers 'lst'.
 * The function should return the sum of all numbers in 'lst' that are greater than 'n' using a while loop.
 *
 * Example:
 * greaterThanWhileLoop(5, listOf(4, 8, 3, 2, 9, 6)) -> 23
 *
 * @param n An integer value.
 * @param lst A list of integers.
 * @return The sum of all numbers in 'lst' greater than 'n'.
 */
fun greaterThanWhileLoop(n: Int, lst: List<Int>): Int {

    var totalSum = 0
    var i = 0

    while (i < lst.size) {
        if (lst[i] > n) {
            totalSum += lst[i]
        }
        i++
    }

    return totalSum
}