/**
 * This function removes outliers from a list of data based on a given threshold.
 *
 * @param dataPoints List of data points.
 * @param threshold Threshold value to determine outliers.
 * @return List of data points with outliers removed.
 */
fun removeOutliers(dataPoints: List<Int>, threshold: Int): List<Int> {

    val cleanedData = mutableListOf<Int>()
    for (value in dataPoints) {
        // Check if the current value is greater than or equal to the threshold
        val cleanedValue = if (value >= threshold) {
            // Replace the value with 0 if it exceeds the threshold
            0
        } else {
            // Subtract 1 from the value if it is less than the threshold
            value - 1
        }
        cleanedData.add(cleanedValue)
    }
    return cleanedData
}
/**
 * This function removes outliers from a list of data based on a given threshold.
 *
 * @param dataPoints List of data points.
 * @param threshold Threshold value to determine outliers.
 * @return List of data points with outliers removed.
 */
fun removeOutliers(dataPoints: List<Int>, threshold: Int): List<Int> {
/**
 * This function removes outliers from a list of data based on a given threshold.
 *
 * @param dataPoints List of data points.
 * @param threshold Threshold value to determine outliers.
 * @return List of data points with outliers removed.
 */
fun removeOutliers(dataPoints: List<Int>, threshold: Int): List<Int> {

    val cleanedData = mutableListOf<Int>()
    for (value in dataPoints) {
        // Check if the current value is greater than or equal to the threshold
        val cleanedValue = if (value >= threshold) {
            // Replace the value with 0 if it exceeds the threshold
            0
        } else {
            // Subtract 1 from the value if it is less than the threshold
            value - 1
        }
        cleanedData.add(cleanedValue)
    }
    return cleanedData
}