/**
 * Imagine a dancer performing a dance routine with a series of moves,
 * represented by integers. Each dance move is associated with a specific
 * weight that determines its complexity. Modify the given dancer's move
 * list and update the weights of each move in a dictionary.
 *
 * @param dancer A dictionary containing the dancer's name and move details.
 * @return The modified dancer dictionary with updated move weights.
 */
fun danceMoves(dancer: MutableMap<String, Any>): MutableMap<String, Any> {

    // Obtaining the dancer's name and move list
    val dancerName = dancer["name"] as String
    val moveList = dancer["moves"] as List<String>

    // Initial map containing move weights
    val moveWeights = mutableMapOf(
        "step" to 5,
        "spin" to 8,
        "jump" to 10,
        "twist" to 7,
        "hop" to 6
    )

    // Selecting a random move and modifying its weight
    val randomMove = moveList.random()
    moveWeights[randomMove] = moveWeights.getValue(randomMove) - 3

    // Updating the dancer's move list and move weights in the dictionary
    dancer["moves"] = moveList
    dancer["moveWeights"] = moveWeights

    return dancer
}
/**
 * Imagine a dancer performing a dance routine with a series of moves,
 * represented by integers. Each dance move is associated with a specific
 * weight that determines its complexity. Modify the given dancer's move
 * list and update the weights of each move in a dictionary.
 *
 * @param dancer A dictionary containing the dancer's name and move details.
 * @return The modified dancer dictionary with updated move weights.
 */
fun danceMoves(dancer: MutableMap<String, Any>): MutableMap<String, Any> {
/**
 * Imagine a dancer performing a dance routine with a series of moves,
 * represented by integers. Each dance move is associated with a specific
 * weight that determines its complexity. Modify the given dancer's move
 * list and update the weights of each move in a dictionary.
 *
 * @param dancer A dictionary containing the dancer's name and move details.
 * @return The modified dancer dictionary with updated move weights.
 */
fun danceMoves(dancer: MutableMap<String, Any>): MutableMap<String, Any> {

    // Obtaining the dancer's name and move list
    val dancerName = dancer["name"] as String
    val moveList = dancer["moves"] as List<String>

    // Initial map containing move weights
    val moveWeights = mutableMapOf(
        "step" to 5,
        "spin" to 8,
        "jump" to 10,
        "twist" to 7,
        "hop" to 6
    )

    // Selecting a random move and modifying its weight
    val randomMove = moveList.random()
    moveWeights[randomMove] = moveWeights.getValue(randomMove) - 3

    // Updating the dancer's move list and move weights in the dictionary
    dancer["moves"] = moveList
    dancer["moveWeights"] = moveWeights

    return dancer
}