/**
 * This function takes two lists as input and returns a new list
 * that contains the concatenation of the original lists with repeated elements.
 */
fun concatenateRepeatLists(list1: List<Any>, list2: List<Any>): List<Any> {

    // Check if either list is empty, if empty return an empty list
    if (list1.isEmpty() || list2.isEmpty()) {
        return emptyList()
    }

    // Concatenate the two lists
    val concatenatedList = list1 + list2

    // Repeat each element in the concatenated list three times
    val repeatedList = concatenatedList.flatMap { listOf(it, it, it) }

    return repeatedList
}
/**
 * This function takes two lists as input and returns a new list
 * that contains the concatenation of the original lists with repeated elements.
 */
fun concatenateRepeatLists(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function takes two lists as input and returns a new list
 * that contains the concatenation of the original lists with repeated elements.
 */
fun concatenateRepeatLists(list1: List<Any>, list2: List<Any>): List<Any> {

    // Check if either list is empty, if empty return an empty list
    if (list1.isEmpty() || list2.isEmpty()) {
        return emptyList()
    }

    // Concatenate the two lists
    val concatenatedList = list1 + list2

    // Repeat each element in the concatenated list three times
    val repeatedList = concatenatedList.flatMap { listOf(it, it, it) }

    return repeatedList
}