/**
 * Given a list of floating-point numbers representing brightness values of pixels in a photograph, round each number to a specified precision.
 *
 * @param photoData A list of floating-point numbers representing pixel brightness values.
 * @param precision An integer specifying the precision to round each value to.
 * @return A list of rounded floating-point numbers.
 */
fun roundDecimalValues(photoData: List<Double>, precision: Int): List<Double> {

    val roundedValues = mutableListOf<Double>()

    for (value in photoData) {
        val scaledValue = value * Math.pow(10.0, precision.toDouble())
        val roundedValue = Math.round(scaledValue).toDouble()
        val finalValue = roundedValue / Math.pow(10.0, precision.toDouble())
        roundedValues.add(finalValue)
    }

    return roundedValues
}
/**
 * Given a list of floating-point numbers representing brightness values of pixels in a photograph, round each number to a specified precision.
 *
 * @param photoData A list of floating-point numbers representing pixel brightness values.
 * @param precision An integer specifying the precision to round each value to.
 * @return A list of rounded floating-point numbers.
 */
fun roundDecimalValues(photoData: List<Double>, precision: Int): List<Double> {
/**
 * Given a list of floating-point numbers representing brightness values of pixels in a photograph, round each number to a specified precision.
 *
 * @param photoData A list of floating-point numbers representing pixel brightness values.
 * @param precision An integer specifying the precision to round each value to.
 * @return A list of rounded floating-point numbers.
 */
fun roundDecimalValues(photoData: List<Double>, precision: Int): List<Double> {

    val roundedValues = mutableListOf<Double>()

    for (value in photoData) {
        val scaledValue = value * Math.pow(10.0, precision.toDouble())
        val roundedValue = Math.round(scaledValue).toDouble()
        val finalValue = roundedValue / Math.pow(10.0, precision.toDouble())
        roundedValues.add(finalValue)
    }

    return roundedValues
}