/**
 * Given a list of tuples containing integer values, update each tuple by incrementing the first element
 * by the second element and updating the second element to be the sum of the first element and the second element.
 *
 * @param tuplesList A list of tuples containing integer values.
 * @return A new list of updated tuples.
 *
 * Example:
 * updateTuples(listOf(1 to 2, 3 to 4, 5 to 6)) returns [(3, 3), (7, 11), (11, 17)]
 */
fun updateTuples(tuplesList: List<Pair<Int, Int>>): List<Pair<Int, Int>> {

    val updatedTuples = mutableListOf<Pair<Int, Int>>()
    for (tup in tuplesList) {
        val first = tup.first
        val second = tup.second
        val updatedFirst = first + second
        val updatedSecond = first + updatedFirst
        updatedTuples.add(updatedFirst to updatedSecond)
    }
    return updatedTuples
}
/**
 * Given a list of tuples containing integer values, update each tuple by incrementing the first element
 * by the second element and updating the second element to be the sum of the first element and the second element.
 *
 * @param tuplesList A list of tuples containing integer values.
 * @return A new list of updated tuples.
 *
 * Example:
 * updateTuples(listOf(1 to 2, 3 to 4, 5 to 6)) returns [(3, 3), (7, 11), (11, 17)]
 */
fun updateTuples(tuplesList: List<Pair<Int, Int>>): List<Pair<Int, Int>> {
/**
 * Given a list of tuples containing integer values, update each tuple by incrementing the first element
 * by the second element and updating the second element to be the sum of the first element and the second element.
 *
 * @param tuplesList A list of tuples containing integer values.
 * @return A new list of updated tuples.
 *
 * Example:
 * updateTuples(listOf(1 to 2, 3 to 4, 5 to 6)) returns [(3, 3), (7, 11), (11, 17)]
 */
fun updateTuples(tuplesList: List<Pair<Int, Int>>): List<Pair<Int, Int>> {

    val updatedTuples = mutableListOf<Pair<Int, Int>>()
    for (tup in tuplesList) {
        val first = tup.first
        val second = tup.second
        val updatedFirst = first + second
        val updatedSecond = first + updatedFirst
        updatedTuples.add(updatedFirst to updatedSecond)
    }
    return updatedTuples
}