/**
 * Given a list of player scores, update the score of a specific player with a new value.
 *
 * @param scores A list of player scores.
 * @param playerId The ID of the player whose score needs to be updated.
 * @param newScore The new score for the player.
 * @return True if the player's score was successfully updated, False otherwise.
 */
fun updatePlayerScore(scores: MutableList<HashMap<String, Int>>, playerId: Int, newScore: Int): Boolean {

    for (score in scores) {
        if (score["player_id"] == playerId) {
            score["score"] = newScore
            return true
        }
    }
    return false
}

// Exercise usage example
/**
 * Given a list of player scores, update the score of a specific player with a new value.
 *
 * @param scores A list of player scores.
 * @param playerId The ID of the player whose score needs to be updated.
 * @param newScore The new score for the player.
 * @return True if the player's score was successfully updated, False otherwise.
 */
fun updatePlayerScore(scores: MutableList<HashMap<String, Int>>, playerId: Int, newScore: Int): Boolean {
/**
 * Given a list of player scores, update the score of a specific player with a new value.
 *
 * @param scores A list of player scores.
 * @param playerId The ID of the player whose score needs to be updated.
 * @param newScore The new score for the player.
 * @return True if the player's score was successfully updated, False otherwise.
 */
fun updatePlayerScore(scores: MutableList<HashMap<String, Int>>, playerId: Int, newScore: Int): Boolean {

    for (score in scores) {
        if (score["player_id"] == playerId) {
            score["score"] = newScore
            return true
        }
    }
    return false
}

// Exercise usage example