/**
 * This function takes in an integer n and a list of initial values, and creates a list of length n with the initial values repeated in an infinite loop until the list is filled.
 * The function returns the created list.
 */
fun createListWithInitialElements(n: Int, initialValues: List<Int>): List<Int> {

    val result = mutableListOf<Int>()
    val initialLen = initialValues.size

    while (result.size < n) {
        for (value in initialValues) {
            result.add(value)
            if (result.size == n) {
                break
            }
        }
    }

    return result
}
/**
 * This function takes in an integer n and a list of initial values, and creates a list of length n with the initial values repeated in an infinite loop until the list is filled.
 * The function returns the created list.
 */
fun createListWithInitialElements(n: Int, initialValues: List<Int>): List<Int> {
/**
 * This function takes in an integer n and a list of initial values, and creates a list of length n with the initial values repeated in an infinite loop until the list is filled.
 * The function returns the created list.
 */
fun createListWithInitialElements(n: Int, initialValues: List<Int>): List<Int> {

    val result = mutableListOf<Int>()
    val initialLen = initialValues.size

    while (result.size < n) {
        for (value in initialValues) {
            result.add(value)
            if (result.size == n) {
                break
            }
        }
    }

    return result
}