/**
 * This function takes two tuples as input and performs the following operations:
 * 1. Subtract the second tuple from the first tuple element-wise.
 * 2. Concatenate the resulting tuple with the first tuple and return the final tuple.
 *
 * @param tup1 First input tuple.
 * @param tup2 Second input tuple.
 * @return Final tuple obtained after subtraction and concatenation.
 *
 * Example:
 * subtractAndConcatenateTuples(listOf(1, 2, 3), listOf(4, 5, 6)) // Output: listOf(-3, -3, -3, 1, 2, 3)
 */
fun subtractAndConcatenateTuples(tup1: List<Int>, tup2: List<Int>): List<Int> {

    // Subtracting tuples element-wise
    val resultTuple = tup1.zip(tup2).map { it.first - it.second }

    // Concatenating the resulting tuple with the first tuple
    val finalTuple = tup1 + resultTuple

    return finalTuple
}
/**
 * This function takes two tuples as input and performs the following operations:
 * 1. Subtract the second tuple from the first tuple element-wise.
 * 2. Concatenate the resulting tuple with the first tuple and return the final tuple.
 *
 * @param tup1 First input tuple.
 * @param tup2 Second input tuple.
 * @return Final tuple obtained after subtraction and concatenation.
 *
 * Example:
 * subtractAndConcatenateTuples(listOf(1, 2, 3), listOf(4, 5, 6)) // Output: listOf(-3, -3, -3, 1, 2, 3)
 */
fun subtractAndConcatenateTuples(tup1: List<Int>, tup2: List<Int>): List<Int> {
/**
 * This function takes two tuples as input and performs the following operations:
 * 1. Subtract the second tuple from the first tuple element-wise.
 * 2. Concatenate the resulting tuple with the first tuple and return the final tuple.
 *
 * @param tup1 First input tuple.
 * @param tup2 Second input tuple.
 * @return Final tuple obtained after subtraction and concatenation.
 *
 * Example:
 * subtractAndConcatenateTuples(listOf(1, 2, 3), listOf(4, 5, 6)) // Output: listOf(-3, -3, -3, 1, 2, 3)
 */
fun subtractAndConcatenateTuples(tup1: List<Int>, tup2: List<Int>): List<Int> {

    // Subtracting tuples element-wise
    val resultTuple = tup1.zip(tup2).map { it.first - it.second }

    // Concatenating the resulting tuple with the first tuple
    val finalTuple = tup1 + resultTuple

    return finalTuple
}