/**
 * This exercise focuses on exiting while loops and slicing tuples.
 *
 * Given a list of tuples, the function will iteratively sum the first element of each tuple until the sum becomes greater than or equal to 100.
 *
 * You are required to implement the exiting condition for the while loop and use slicing to access the first element of each tuple.
 *
 * Complete the code to return the final sum of the first elements that were added.
 */
fun exitingSlicingTuples(tupleList: List<Pair<Int, Int>>): Int {

    var totalSum = 0  // Initialize the sum variable

    var index = 0
    while (totalSum < 100 && index < tupleList.size) {
        totalSum += tupleList[index].first
        index++
    }

    return totalSum  // Return the final sum
}
/**
 * This exercise focuses on exiting while loops and slicing tuples.
 *
 * Given a list of tuples, the function will iteratively sum the first element of each tuple until the sum becomes greater than or equal to 100.
 *
 * You are required to implement the exiting condition for the while loop and use slicing to access the first element of each tuple.
 *
 * Complete the code to return the final sum of the first elements that were added.
 */
fun exitingSlicingTuples(tupleList: List<Pair<Int, Int>>): Int {
/**
 * This exercise focuses on exiting while loops and slicing tuples.
 *
 * Given a list of tuples, the function will iteratively sum the first element of each tuple until the sum becomes greater than or equal to 100.
 *
 * You are required to implement the exiting condition for the while loop and use slicing to access the first element of each tuple.
 *
 * Complete the code to return the final sum of the first elements that were added.
 */
fun exitingSlicingTuples(tupleList: List<Pair<Int, Int>>): Int {

    var totalSum = 0  // Initialize the sum variable

    var index = 0
    while (totalSum < 100 && index < tupleList.size) {
        totalSum += tupleList[index].first
        index++
    }

    return totalSum  // Return the final sum
}