/**
 * Modify the given list by replacing each element divisible by the given divisor with its square root.
 *
 * @param list1 A list of integers.
 * @param divisor An integer divisor to check against.
 * @return The modified list.
 */
fun modifyList(list1: List<Int>, divisor: Int): List<Double> {

    // Use map to modify the list
    return list1.map { if (it % divisor == 0) Math.sqrt(it.toDouble()) else it.toDouble() }
}
/**
 * Modify the given list by replacing each element divisible by the given divisor with its square root.
 *
 * @param list1 A list of integers.
 * @param divisor An integer divisor to check against.
 * @return The modified list.
 */
fun modifyList(list1: List<Int>, divisor: Int): List<Double> {
/**
 * Modify the given list by replacing each element divisible by the given divisor with its square root.
 *
 * @param list1 A list of integers.
 * @param divisor An integer divisor to check against.
 * @return The modified list.
 */
fun modifyList(list1: List<Int>, divisor: Int): List<Double> {

    // Use map to modify the list
    return list1.map { if (it % divisor == 0) Math.sqrt(it.toDouble()) else it.toDouble() }
}