/**
 * Given a list of dance moves and an index, modify the specified move of a dancer
 * by adding an exclamation mark at the end. If the index is out of bounds, handle the
 * error gracefully and return the original list of moves.
 *
 * @param dancer The name of the dancer
 * @param moves A list of dance moves
 * @param index The index of the move to modify
 * @return The modified list of dance moves with the specified move modified or the
 *         original list of moves if the index is out of bounds
 */
fun modifyDancerMoves(dancer: String, moves: MutableList<String>, index: Int): List<String> {

    try {
        moves[index] = moves[index] + "!" // Modify the specified move by adding an exclamation mark
        return moves
    } catch (e: IndexOutOfBoundsException) {
        return moves // Return the original list of moves if index is out of bounds
    }
}
/**
 * Given a list of dance moves and an index, modify the specified move of a dancer
 * by adding an exclamation mark at the end. If the index is out of bounds, handle the
 * error gracefully and return the original list of moves.
 *
 * @param dancer The name of the dancer
 * @param moves A list of dance moves
 * @param index The index of the move to modify
 * @return The modified list of dance moves with the specified move modified or the
 *         original list of moves if the index is out of bounds
 */
fun modifyDancerMoves(dancer: String, moves: MutableList<String>, index: Int): List<String> {
/**
 * Given a list of dance moves and an index, modify the specified move of a dancer
 * by adding an exclamation mark at the end. If the index is out of bounds, handle the
 * error gracefully and return the original list of moves.
 *
 * @param dancer The name of the dancer
 * @param moves A list of dance moves
 * @param index The index of the move to modify
 * @return The modified list of dance moves with the specified move modified or the
 *         original list of moves if the index is out of bounds
 */
fun modifyDancerMoves(dancer: String, moves: MutableList<String>, index: Int): List<String> {

    try {
        moves[index] = moves[index] + "!" // Modify the specified move by adding an exclamation mark
        return moves
    } catch (e: IndexOutOfBoundsException) {
        return moves // Return the original list of moves if index is out of bounds
    }
}