/**
 * Given a list of altitudes, find the maximum altitude using the ternary operator and loop through the list.
 *
 * @param altitudeList A list of altitudes.
 * @return The maximum altitude.
 */
fun findMaxAltitude(altitudeList: List<Int>): Int {

    // Initialize the maximum altitude as the first element of the list
    var maxAltitude = altitudeList[0]

    // Loop through the remaining elements of the list using a ternary operator
    for (altitude in altitudeList.subList(1, altitudeList.size)) {
        maxAltitude = if (altitude > maxAltitude) altitude else maxAltitude
    }

    return maxAltitude
}
/**
 * Given a list of altitudes, find the maximum altitude using the ternary operator and loop through the list.
 *
 * @param altitudeList A list of altitudes.
 * @return The maximum altitude.
 */
fun findMaxAltitude(altitudeList: List<Int>): Int {
/**
 * Given a list of altitudes, find the maximum altitude using the ternary operator and loop through the list.
 *
 * @param altitudeList A list of altitudes.
 * @return The maximum altitude.
 */
fun findMaxAltitude(altitudeList: List<Int>): Int {

    // Initialize the maximum altitude as the first element of the list
    var maxAltitude = altitudeList[0]

    // Loop through the remaining elements of the list using a ternary operator
    for (altitude in altitudeList.subList(1, altitudeList.size)) {
        maxAltitude = if (altitude > maxAltitude) altitude else maxAltitude
    }

    return maxAltitude
}