/**
 * Repeats each element in a tuple 'n' times.
 *
 * @param tup The input tuple.
 * @param n The number of times to repeat each element.
 * @return The resulting tuple with repeated elements.
 */
fun repeatTupleElements(tup: List<Any>, n: Int): List<Any> {

    // Create an empty list to store the repeated elements
    val repeatedElements = mutableListOf<Any>()

    // Repeat each element 'n' times
    for (element in tup) {
        repeatedElements.addAll(List(n) { element })
    }

    return repeatedElements
}

// Given two arrays, concatenate them and store the result in the variable 'concatenatedArray'
val array1 = arrayOf(1, 2, 3)
val array2 = arrayOf(4, 5, 6)
val concatenatedArray = array1 + array2
/**
 * Repeats each element in a tuple 'n' times.
 *
 * @param tup The input tuple.
 * @param n The number of times to repeat each element.
 * @return The resulting tuple with repeated elements.
 */
fun repeatTupleElements(tup: List<Any>, n: Int): List<Any> {
/**
 * Repeats each element in a tuple 'n' times.
 *
 * @param tup The input tuple.
 * @param n The number of times to repeat each element.
 * @return The resulting tuple with repeated elements.
 */
fun repeatTupleElements(tup: List<Any>, n: Int): List<Any> {

    // Create an empty list to store the repeated elements
    val repeatedElements = mutableListOf<Any>()

    // Repeat each element 'n' times
    for (element in tup) {
        repeatedElements.addAll(List(n) { element })
    }

    return repeatedElements
}

// Given two arrays, concatenate them and store the result in the variable 'concatenatedArray'
val array1 = arrayOf(1, 2, 3)
val array2 = arrayOf(4, 5, 6)
val concatenatedArray = array1 + array2