/**
 * This function takes two lists of tuples as inputs and an index value. The function concatenates the tuples
 * at the corresponding indices from both lists and returns the element at the specified nested index.
 *
 * @param tupleList1 A list of tuples
 * @param tupleList2 A list of tuples of same length as tupleList1
 * @param index A nested index to access a specific element in the concatenated tuples
 * @return The element at the specified nested index in the concatenated tuples
 */
fun concatAndAccess(tupleList1: List<Pair<Int, Int>>, tupleList2: List<Pair<Int, Int>>, index: Pair<Int, Int>): Int {

    val concatenatedTuples = tupleList1.zip(tupleList2) { tuple1, tuple2 -> Pair(tuple1.first + tuple2.first, tuple1.second + tuple2.second) }
    val nestedIndexValue = concatenatedTuples[index.first].toList()[index.second]

    return nestedIndexValue
}
/**
 * This function takes two lists of tuples as inputs and an index value. The function concatenates the tuples
 * at the corresponding indices from both lists and returns the element at the specified nested index.
 *
 * @param tupleList1 A list of tuples
 * @param tupleList2 A list of tuples of same length as tupleList1
 * @param index A nested index to access a specific element in the concatenated tuples
 * @return The element at the specified nested index in the concatenated tuples
 */
fun concatAndAccess(tupleList1: List<Pair<Int, Int>>, tupleList2: List<Pair<Int, Int>>, index: Pair<Int, Int>): Int {
/**
 * This function takes two lists of tuples as inputs and an index value. The function concatenates the tuples
 * at the corresponding indices from both lists and returns the element at the specified nested index.
 *
 * @param tupleList1 A list of tuples
 * @param tupleList2 A list of tuples of same length as tupleList1
 * @param index A nested index to access a specific element in the concatenated tuples
 * @return The element at the specified nested index in the concatenated tuples
 */
fun concatAndAccess(tupleList1: List<Pair<Int, Int>>, tupleList2: List<Pair<Int, Int>>, index: Pair<Int, Int>): Int {

    val concatenatedTuples = tupleList1.zip(tupleList2) { tuple1, tuple2 -> Pair(tuple1.first + tuple2.first, tuple1.second + tuple2.second) }
    val nestedIndexValue = concatenatedTuples[index.first].toList()[index.second]

    return nestedIndexValue
}