/**
 * This Chef code completion exercise requires implementing a function that concatenates and repeats the given
 * list of ingredients a specified number of times.
 *
 * @param chefList A list of ingredients
 * @param times The number of times the list should be repeated
 * @return A tuple containing the concatenated and repeated ingredients
 *
 * Example:
 * concatenateRepeat(listOf("salt", "pepper"), 3) // Output: listOf("salt", "pepper", "salt", "pepper", "salt", "pepper")
 */
fun concatenateRepeat(chefList: List<String>, times: Int): List<String> {

    val concatenatedIngredients = chefList.flatMap { ingredient -> List(times) { ingredient } }
    return concatenatedIngredients
}
/**
 * This Chef code completion exercise requires implementing a function that concatenates and repeats the given
 * list of ingredients a specified number of times.
 *
 * @param chefList A list of ingredients
 * @param times The number of times the list should be repeated
 * @return A tuple containing the concatenated and repeated ingredients
 *
 * Example:
 * concatenateRepeat(listOf("salt", "pepper"), 3) // Output: listOf("salt", "pepper", "salt", "pepper", "salt", "pepper")
 */
fun concatenateRepeat(chefList: List<String>, times: Int): List<String> {
/**
 * This Chef code completion exercise requires implementing a function that concatenates and repeats the given
 * list of ingredients a specified number of times.
 *
 * @param chefList A list of ingredients
 * @param times The number of times the list should be repeated
 * @return A tuple containing the concatenated and repeated ingredients
 *
 * Example:
 * concatenateRepeat(listOf("salt", "pepper"), 3) // Output: listOf("salt", "pepper", "salt", "pepper", "salt", "pepper")
 */
fun concatenateRepeat(chefList: List<String>, times: Int): List<String> {

    val concatenatedIngredients = chefList.flatMap { ingredient -> List(times) { ingredient } }
    return concatenatedIngredients
}