/**
 * This function compares tuples and modifies elements.
 *
 * Given a list of tuples, each containing numbers, the function will compare the tuples and modify specific elements.
 * The function will return a new list of modified tuples.
 *
 * @param tuplesList A list of tuples containing numbers.
 * @return A new list of modified tuples where the elements have been compared and modified.
 */
fun compareAndModifyTuples(tuplesList: List<Pair<Int, Int>>): List<Pair<Int, Int>> {

    val result = mutableListOf<Pair<Int, Int>>()  // Initialize an empty list to store modified tuples

    for (tuple in tuplesList) {
        if (tuple.first < 2) {  // Ignore tuples with less than 2 elements
            continue
        }

        val modifiedTuple = mutableListOf(tuple.first, tuple.second)  // Convert tuple to list for element modification

        // Compare and modify specific elements
        for (i in modifiedTuple.indices) {
            if (i == 0) {
                modifiedTuple[i] = modifiedTuple[i] + 10
            } else {
                modifiedTuple[i] = modifiedTuple[i] - 5
            }
        }

        result.add(Pair(modifiedTuple[0], modifiedTuple[1]))  // Convert modified list back to tuple and add to result list
    }

    return result
}
/**
 * This function compares tuples and modifies elements.
 *
 * Given a list of tuples, each containing numbers, the function will compare the tuples and modify specific elements.
 * The function will return a new list of modified tuples.
 *
 * @param tuplesList A list of tuples containing numbers.
 * @return A new list of modified tuples where the elements have been compared and modified.
 */
fun compareAndModifyTuples(tuplesList: List<Pair<Int, Int>>): List<Pair<Int, Int>> {
/**
 * This function compares tuples and modifies elements.
 *
 * Given a list of tuples, each containing numbers, the function will compare the tuples and modify specific elements.
 * The function will return a new list of modified tuples.
 *
 * @param tuplesList A list of tuples containing numbers.
 * @return A new list of modified tuples where the elements have been compared and modified.
 */
fun compareAndModifyTuples(tuplesList: List<Pair<Int, Int>>): List<Pair<Int, Int>> {

    val result = mutableListOf<Pair<Int, Int>>()  // Initialize an empty list to store modified tuples

    for (tuple in tuplesList) {
        if (tuple.first < 2) {  // Ignore tuples with less than 2 elements
            continue
        }

        val modifiedTuple = mutableListOf(tuple.first, tuple.second)  // Convert tuple to list for element modification

        // Compare and modify specific elements
        for (i in modifiedTuple.indices) {
            if (i == 0) {
                modifiedTuple[i] = modifiedTuple[i] + 10
            } else {
                modifiedTuple[i] = modifiedTuple[i] - 5
            }
        }

        result.add(Pair(modifiedTuple[0], modifiedTuple[1]))  // Convert modified list back to tuple and add to result list
    }

    return result
}