/**
 * Function to calculate the average game performance of an athlete.
 *
 * @param athlete Name of the athlete.
 * @param gameScores List of lists containing the game scores of the athlete.
 * @return A message displaying the average game performance of the athlete.
 */
fun findGamePerformance(athlete: String, gameScores: List<List<Int>>): String {

    var totalGames = 0
    var totalScore = 0

    for (game in gameScores) {
        for (score in game) {
            if (score <= 0) {
                break
            }
            totalGames++
            totalScore += score
        }
        if (game.any { it <= 0 }) {
            break
        }
    }

    val averagePerformance = totalScore.toDouble() / totalGames

    return "$athlete's average game performance is %.2f".format(averagePerformance)
}
/**
 * Function to calculate the average game performance of an athlete.
 *
 * @param athlete Name of the athlete.
 * @param gameScores List of lists containing the game scores of the athlete.
 * @return A message displaying the average game performance of the athlete.
 */
fun findGamePerformance(athlete: String, gameScores: List<List<Int>>): String {
/**
 * Function to calculate the average game performance of an athlete.
 *
 * @param athlete Name of the athlete.
 * @param gameScores List of lists containing the game scores of the athlete.
 * @return A message displaying the average game performance of the athlete.
 */
fun findGamePerformance(athlete: String, gameScores: List<List<Int>>): String {

    var totalGames = 0
    var totalScore = 0

    for (game in gameScores) {
        for (score in game) {
            if (score <= 0) {
                break
            }
            totalGames++
            totalScore += score
        }
        if (game.any { it <= 0 }) {
            break
        }
    }

    val averagePerformance = totalScore.toDouble() / totalGames

    return "$athlete's average game performance is %.2f".format(averagePerformance)
}