/**
 * This function takes a list of tuples and merges them into a single tuple.
 * Each tuple can be repeated a certain number of times.
 *
 * @param tuples A list of tuples
 * @return The merged tuple of all the given tuples
 *
 * Example:
 * mergeTuples(listOf(1 to 2, 3 to 4)) -> (1, 2, 3, 4)
 */
fun mergeTuples(tuples: List<Pair<Int, Int>>): List<Int> {

    val result = mutableListOf<Int>()
    for (tuple in tuples) {
        result.addAll(tuple.toList())
    }
    return result
}
/**
 * This function takes a list of tuples and merges them into a single tuple.
 * Each tuple can be repeated a certain number of times.
 *
 * @param tuples A list of tuples
 * @return The merged tuple of all the given tuples
 *
 * Example:
 * mergeTuples(listOf(1 to 2, 3 to 4)) -> (1, 2, 3, 4)
 */
fun mergeTuples(tuples: List<Pair<Int, Int>>): List<Int> {
/**
 * This function takes a list of tuples and merges them into a single tuple.
 * Each tuple can be repeated a certain number of times.
 *
 * @param tuples A list of tuples
 * @return The merged tuple of all the given tuples
 *
 * Example:
 * mergeTuples(listOf(1 to 2, 3 to 4)) -> (1, 2, 3, 4)
 */
fun mergeTuples(tuples: List<Pair<Int, Int>>): List<Int> {

    val result = mutableListOf<Int>()
    for (tuple in tuples) {
        result.addAll(tuple.toList())
    }
    return result
}