/**
 * This function takes a list of elements and a threshold value. It slices the list to only include elements that are 
 * greater than the threshold, and then replaces those elements with their square root.
 *
 * @param elements List of elements
 * @param threshold Threshold value for comparison
 * @return A new list with elements greater than the threshold replaced by their square root.
 */
fun sliceAndReplace(elements: List<Double>, threshold: Double): List<Double> {

    val slicedElements = elements.filter { it > threshold }.map { Math.sqrt(it) }
    return slicedElements
}
/**
 * This function takes a list of elements and a threshold value. It slices the list to only include elements that are 
 * greater than the threshold, and then replaces those elements with their square root.
 *
 * @param elements List of elements
 * @param threshold Threshold value for comparison
 * @return A new list with elements greater than the threshold replaced by their square root.
 */
fun sliceAndReplace(elements: List<Double>, threshold: Double): List<Double> {
/**
 * This function takes a list of elements and a threshold value. It slices the list to only include elements that are 
 * greater than the threshold, and then replaces those elements with their square root.
 *
 * @param elements List of elements
 * @param threshold Threshold value for comparison
 * @return A new list with elements greater than the threshold replaced by their square root.
 */
fun sliceAndReplace(elements: List<Double>, threshold: Double): List<Double> {

    val slicedElements = elements.filter { it > threshold }.map { Math.sqrt(it) }
    return slicedElements
}