/**
 * Checks if the dancer is on rhythm at a specific beat.
 */
fun checkRhythm(steps: List<String>, beat: Int) {

    for ((index, step) in steps.withIndex()) {
        if (index % beat != 0) {
            println("Not on rhythm at beat $index")
            break
        }
    }
    println("Perfect rhythm!")
}
/**
 * Checks if the dancer is on rhythm at a specific beat.
 */
fun checkRhythm(steps: List<String>, beat: Int) {
/**
 * Checks if the dancer is on rhythm at a specific beat.
 */
fun checkRhythm(steps: List<String>, beat: Int) {

    for ((index, step) in steps.withIndex()) {
        if (index % beat != 0) {
            println("Not on rhythm at beat $index")
            break
        }
    }
    println("Perfect rhythm!")
}