/**
 * Given a list of elevation values and a list of indices, calculate the average elevation
 * at the given indices.
 *
 * @param elevations A list of integer values representing elevation at different locations
 * @param indices A list of integer values representing indices for which the average elevation
 * needs to be calculated
 * @return A float value representing the average elevation at the given indices
 */
fun calculateAverageElevation(elevations: List<Int>, indices: List<Int>): Float {

    var elevationSum = 0

    for (index in indices) {
        if (index in elevations.indices) {
            elevationSum += elevations[index]
        }
    }

    return elevationSum.toFloat() / indices.size
}
/**
 * Given a list of elevation values and a list of indices, calculate the average elevation
 * at the given indices.
 *
 * @param elevations A list of integer values representing elevation at different locations
 * @param indices A list of integer values representing indices for which the average elevation
 * needs to be calculated
 * @return A float value representing the average elevation at the given indices
 */
fun calculateAverageElevation(elevations: List<Int>, indices: List<Int>): Float {
/**
 * Given a list of elevation values and a list of indices, calculate the average elevation
 * at the given indices.
 *
 * @param elevations A list of integer values representing elevation at different locations
 * @param indices A list of integer values representing indices for which the average elevation
 * needs to be calculated
 * @return A float value representing the average elevation at the given indices
 */
fun calculateAverageElevation(elevations: List<Int>, indices: List<Int>): Float {

    var elevationSum = 0

    for (index in indices) {
        if (index in elevations.indices) {
            elevationSum += elevations[index]
        }
    }

    return elevationSum.toFloat() / indices.size
}