/**
 * Given a dictionary 'gameStats', containing keys as player names and values as their corresponding damage scores
 * during a game session, find and return the name of the player with the highest damage score. If there are multiple
 * players with the same highest damage score, return all their names separated by commas.
 */
fun getHighestDamage(gameStats: Map<String, Int>): String {

    var highestDamage = Int.MIN_VALUE
    val playersWithHighestDamage = mutableListOf<String>()

    for ((player, damage) in gameStats) {
        if (damage > highestDamage) {
            highestDamage = damage
            playersWithHighestDamage.clear()
            playersWithHighestDamage.add(player)
        } else if (damage == highestDamage) {
            playersWithHighestDamage.add(player)
        }
    }

    return playersWithHighestDamage.joinToString(",")
}

// Example usage:
/**
 * Given a dictionary 'gameStats', containing keys as player names and values as their corresponding damage scores
 * during a game session, find and return the name of the player with the highest damage score. If there are multiple
 * players with the same highest damage score, return all their names separated by commas.
 */
fun getHighestDamage(gameStats: Map<String, Int>): String {
/**
 * Given a dictionary 'gameStats', containing keys as player names and values as their corresponding damage scores
 * during a game session, find and return the name of the player with the highest damage score. If there are multiple
 * players with the same highest damage score, return all their names separated by commas.
 */
fun getHighestDamage(gameStats: Map<String, Int>): String {

    var highestDamage = Int.MIN_VALUE
    val playersWithHighestDamage = mutableListOf<String>()

    for ((player, damage) in gameStats) {
        if (damage > highestDamage) {
            highestDamage = damage
            playersWithHighestDamage.clear()
            playersWithHighestDamage.add(player)
        } else if (damage == highestDamage) {
            playersWithHighestDamage.add(player)
        }
    }

    return playersWithHighestDamage.joinToString(",")
}

// Example usage: