/**
 * This function takes in a list of dance steps and a string representing the rhythm,
 * and returns the number of times the dancer should perform each dance step based on the rhythm.
 *
 * @param steps A list of dance steps.
 * @param rhythm A string representing the rhythm.
 * @return A dictionary containing each dance step as the key and the total number of times to perform as the value.
 */
fun danceMoves(steps: List<String>, rhythm: String): Map<String, Int> {

    // Create an empty dictionary to store the dance step count
    val danceStepCount = mutableMapOf<String, Int>()

    // Iterate over each dance step
    steps.forEach { step ->
        // Initialize the count for each dance step to 0
        danceStepCount[step] = 0
    }

    // Calculate the length of the rhythm
    val rhythmLength = rhythm.length

    // Iterate over each character in the rhythm
    for (i in 0 until rhythmLength) {
        // Get the current dance step associated with the rhythm character
        val currentStep = steps[i % steps.size]

        // Increment the count for the current dance step
        danceStepCount[currentStep] = danceStepCount.getOrDefault(currentStep, 0) + 1
    }

    return danceStepCount
}
/**
 * This function takes in a list of dance steps and a string representing the rhythm,
 * and returns the number of times the dancer should perform each dance step based on the rhythm.
 *
 * @param steps A list of dance steps.
 * @param rhythm A string representing the rhythm.
 * @return A dictionary containing each dance step as the key and the total number of times to perform as the value.
 */
fun danceMoves(steps: List<String>, rhythm: String): Map<String, Int> {
/**
 * This function takes in a list of dance steps and a string representing the rhythm,
 * and returns the number of times the dancer should perform each dance step based on the rhythm.
 *
 * @param steps A list of dance steps.
 * @param rhythm A string representing the rhythm.
 * @return A dictionary containing each dance step as the key and the total number of times to perform as the value.
 */
fun danceMoves(steps: List<String>, rhythm: String): Map<String, Int> {

    // Create an empty dictionary to store the dance step count
    val danceStepCount = mutableMapOf<String, Int>()

    // Iterate over each dance step
    steps.forEach { step ->
        // Initialize the count for each dance step to 0
        danceStepCount[step] = 0
    }

    // Calculate the length of the rhythm
    val rhythmLength = rhythm.length

    // Iterate over each character in the rhythm
    for (i in 0 until rhythmLength) {
        // Get the current dance step associated with the rhythm character
        val currentStep = steps[i % steps.size]

        // Increment the count for the current dance step
        danceStepCount[currentStep] = danceStepCount.getOrDefault(currentStep, 0) + 1
    }

    return danceStepCount
}