/**
 * Given a list of scores and a list of new scores, append the new scores to the original scores
 * and return the updated list. Be wary of floating-point errors by using epsilon.
 *
 * @param scores A list of floating-point scores.
 * @param newScores A list of floating-point scores to be appended to the original scores.
 * @return The updated list of scores.
 *
 * Example:
 * scores = [9.8, 9.7, 9.5, 9.9]
 * newScores = [9.6, 9.4]
 * addScores(scores, newScores) -> [9.8, 9.7, 9.5, 9.9, 9.6, 9.4]
 */
fun addScores(scores: MutableList<Double>, newScores: List<Double>): List<Double> {

    val epsilon = 1e-10  // Small value to handle floating-point errors
    
    for (score in newScores) {
        var skip = false
        for (existingScore in scores) {
            if (Math.abs(score - existingScore) < epsilon) {
                println("Skipping $score due to floating-point error")
                skip = true
                break
            }
        }
        if (!skip) {
            scores.add(score)
        }
    }
    
    return scores
}
/**
 * Given a list of scores and a list of new scores, append the new scores to the original scores
 * and return the updated list. Be wary of floating-point errors by using epsilon.
 *
 * @param scores A list of floating-point scores.
 * @param newScores A list of floating-point scores to be appended to the original scores.
 * @return The updated list of scores.
 *
 * Example:
 * scores = [9.8, 9.7, 9.5, 9.9]
 * newScores = [9.6, 9.4]
 * addScores(scores, newScores) -> [9.8, 9.7, 9.5, 9.9, 9.6, 9.4]
 */
fun addScores(scores: MutableList<Double>, newScores: List<Double>): List<Double> {
/**
 * Given a list of scores and a list of new scores, append the new scores to the original scores
 * and return the updated list. Be wary of floating-point errors by using epsilon.
 *
 * @param scores A list of floating-point scores.
 * @param newScores A list of floating-point scores to be appended to the original scores.
 * @return The updated list of scores.
 *
 * Example:
 * scores = [9.8, 9.7, 9.5, 9.9]
 * newScores = [9.6, 9.4]
 * addScores(scores, newScores) -> [9.8, 9.7, 9.5, 9.9, 9.6, 9.4]
 */
fun addScores(scores: MutableList<Double>, newScores: List<Double>): List<Double> {

    val epsilon = 1e-10  // Small value to handle floating-point errors
    
    for (score in newScores) {
        var skip = false
        for (existingScore in scores) {
            if (Math.abs(score - existingScore) < epsilon) {
                println("Skipping $score due to floating-point error")
                skip = true
                break
            }
        }
        if (!skip) {
            scores.add(score)
        }
    }
    
    return scores
}