/**
 * Executes a block of code multiple times to perform dance moves using the unconditioned ternary operator.
 *
 * @param dancer The name of the dancer.
 * @param danceMoves A list of dance moves.
 * @param repetition The number of times to perform the dance moves.
 * @return A string representation of the dance performance.
 *
 * Example:
 * val dancer = "John"
 * val danceMoves = listOf("twist", "jump", "spin")
 * val repetition = 3
 *
 * Output:
 * "John performed the twist, jump, and spin 3 times!"
 */
fun performDanceMoves(dancer: String, danceMoves: List<String>, repetition: Int): String {

    var result = "$dancer performed the "

    for (move in danceMoves) {
        result += "$move, "
    }

    result = result.dropLast(2) + " "

    result += "and ${danceMoves.last()}" + if (danceMoves.size > 1) "" else danceMoves.last()

    result += " $repetition times!"
    return result
}
/**
 * Executes a block of code multiple times to perform dance moves using the unconditioned ternary operator.
 *
 * @param dancer The name of the dancer.
 * @param danceMoves A list of dance moves.
 * @param repetition The number of times to perform the dance moves.
 * @return A string representation of the dance performance.
 *
 * Example:
 * val dancer = "John"
 * val danceMoves = listOf("twist", "jump", "spin")
 * val repetition = 3
 *
 * Output:
 * "John performed the twist, jump, and spin 3 times!"
 */
fun performDanceMoves(dancer: String, danceMoves: List<String>, repetition: Int): String {
/**
 * Executes a block of code multiple times to perform dance moves using the unconditioned ternary operator.
 *
 * @param dancer The name of the dancer.
 * @param danceMoves A list of dance moves.
 * @param repetition The number of times to perform the dance moves.
 * @return A string representation of the dance performance.
 *
 * Example:
 * val dancer = "John"
 * val danceMoves = listOf("twist", "jump", "spin")
 * val repetition = 3
 *
 * Output:
 * "John performed the twist, jump, and spin 3 times!"
 */
fun performDanceMoves(dancer: String, danceMoves: List<String>, repetition: Int): String {

    var result = "$dancer performed the "

    for (move in danceMoves) {
        result += "$move, "
    }

    result = result.dropLast(2) + " "

    result += "and ${danceMoves.last()}" + if (danceMoves.size > 1) "" else danceMoves.last()

    result += " $repetition times!"
    return result
}