/**
 * Given a Dancer and a sequence of steps, translate the steps into a dance routine
 * and update the Dancer's routine accordingly.
 *
 * @param dancer The name of the Dancer.
 * @param steps The sequence of steps.
 * @return The updated routine of the Dancer after the translation.
 *
 * Examples:
 * danceTranslation("Amy", "LRRLR") -> "L L R R L"
 * danceTranslation("Bob", "UDDUDDU") -> "U D D U D D U"
 */
fun danceTranslation(dancer: String, steps: String): String {

    var updatedDancer = dancer

    // Iterate over each character of the steps
    for (char in steps) {
        // Add the specific step to the dancer's routine
        updatedDancer += when (char) {
            'L' -> " L"
            'R' -> " R"
            'U' -> " U"
            'D' -> " D"
            else -> ""
        }
    }

    return updatedDancer
}
/**
 * Given a Dancer and a sequence of steps, translate the steps into a dance routine
 * and update the Dancer's routine accordingly.
 *
 * @param dancer The name of the Dancer.
 * @param steps The sequence of steps.
 * @return The updated routine of the Dancer after the translation.
 *
 * Examples:
 * danceTranslation("Amy", "LRRLR") -> "L L R R L"
 * danceTranslation("Bob", "UDDUDDU") -> "U D D U D D U"
 */
fun danceTranslation(dancer: String, steps: String): String {
/**
 * Given a Dancer and a sequence of steps, translate the steps into a dance routine
 * and update the Dancer's routine accordingly.
 *
 * @param dancer The name of the Dancer.
 * @param steps The sequence of steps.
 * @return The updated routine of the Dancer after the translation.
 *
 * Examples:
 * danceTranslation("Amy", "LRRLR") -> "L L R R L"
 * danceTranslation("Bob", "UDDUDDU") -> "U D D U D D U"
 */
fun danceTranslation(dancer: String, steps: String): String {

    var updatedDancer = dancer

    // Iterate over each character of the steps
    for (char in steps) {
        // Add the specific step to the dancer's routine
        updatedDancer += when (char) {
            'L' -> " L"
            'R' -> " R"
            'U' -> " U"
            'D' -> " D"
            else -> ""
        }
    }

    return updatedDancer
}