/**
 * This function generates a histogram for a given photo data array.
 *
 * @param photoData The input photo data as a list of pixel intensities.
 * @param bins The number of bins in the histogram.
 * @return The histogram as a list of frequencies for each bin.
 */
fun generateHistogram(photoData: List<Int>, bins: Int = 256): List<Int> {

    val histogram = MutableList(bins) { 0 }
    for (pixelValue in photoData) {
        histogram[pixelValue] += 1
    }
    return histogram
}
/**
 * This function generates a histogram for a given photo data array.
 *
 * @param photoData The input photo data as a list of pixel intensities.
 * @param bins The number of bins in the histogram.
 * @return The histogram as a list of frequencies for each bin.
 */
fun generateHistogram(photoData: List<Int>, bins: Int = 256): List<Int> {
/**
 * This function generates a histogram for a given photo data array.
 *
 * @param photoData The input photo data as a list of pixel intensities.
 * @param bins The number of bins in the histogram.
 * @return The histogram as a list of frequencies for each bin.
 */
fun generateHistogram(photoData: List<Int>, bins: Int = 256): List<Int> {

    val histogram = MutableList(bins) { 0 }
    for (pixelValue in photoData) {
        histogram[pixelValue] += 1
    }
    return histogram
}