/**
 * A zoologist needs your help to concatenate two tuples and repeat the concatenated tuple n number of times.
 *
 * Given two tuples, tuple1 and tuple2, and a positive integer n, you need to concatenate tuple1 and tuple2, and then repeat the resulting tuple n times.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @param n The number of times to repeat the concatenated tuple.
 * @return The concatenated and repeated tuple.
 *
 * Example:
 * concatenateAndRepeatTuples(listOf(1, 2), listOf(3, 4), 3)
 * Output: [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]
 */
fun concatenateAndRepeatTuples(tuple1: List<Int>, tuple2: List<Int>, n: Int): List<Int> {

    val concatenatedTuple = tuple1 + tuple2
    val repeatedTuple = concatenatedTuple.flatMap { List(n) { it } }
    return repeatedTuple
}
/**
 * A zoologist needs your help to concatenate two tuples and repeat the concatenated tuple n number of times.
 *
 * Given two tuples, tuple1 and tuple2, and a positive integer n, you need to concatenate tuple1 and tuple2, and then repeat the resulting tuple n times.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @param n The number of times to repeat the concatenated tuple.
 * @return The concatenated and repeated tuple.
 *
 * Example:
 * concatenateAndRepeatTuples(listOf(1, 2), listOf(3, 4), 3)
 * Output: [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]
 */
fun concatenateAndRepeatTuples(tuple1: List<Int>, tuple2: List<Int>, n: Int): List<Int> {
/**
 * A zoologist needs your help to concatenate two tuples and repeat the concatenated tuple n number of times.
 *
 * Given two tuples, tuple1 and tuple2, and a positive integer n, you need to concatenate tuple1 and tuple2, and then repeat the resulting tuple n times.
 *
 * @param tuple1 The first tuple.
 * @param tuple2 The second tuple.
 * @param n The number of times to repeat the concatenated tuple.
 * @return The concatenated and repeated tuple.
 *
 * Example:
 * concatenateAndRepeatTuples(listOf(1, 2), listOf(3, 4), 3)
 * Output: [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]
 */
fun concatenateAndRepeatTuples(tuple1: List<Int>, tuple2: List<Int>, n: Int): List<Int> {

    val concatenatedTuple = tuple1 + tuple2
    val repeatedTuple = concatenatedTuple.flatMap { List(n) { it } }
    return repeatedTuple
}