/**
 * Given a list of aircraft data, change the altitude of the aircraft to the new altitude.
 *
 * @param aircraftData A list containing the aircraft data as tuples.
 * @param newAltitude The new altitude to set for the aircraft.
 * @return The modified aircraft data with the altitude updated.
 */
fun changeAltitude(aircraftData: MutableList<Triple<String, Float, Float>>, newAltitude: Float): MutableList<Triple<String, Float, Float>> {

    for (i in aircraftData.indices) {
        // Unpack the aircraft data tuple
        val (name, _, speed) = aircraftData[i]

        // Update the altitude to the new altitude
        // Use the unpacked data to construct the modified aircraft data tuple
        aircraftData[i] = Triple(name, newAltitude, speed)
    }

    return aircraftData
}
/**
 * Given a list of aircraft data, change the altitude of the aircraft to the new altitude.
 *
 * @param aircraftData A list containing the aircraft data as tuples.
 * @param newAltitude The new altitude to set for the aircraft.
 * @return The modified aircraft data with the altitude updated.
 */
fun changeAltitude(aircraftData: MutableList<Triple<String, Float, Float>>, newAltitude: Float): MutableList<Triple<String, Float, Float>> {
/**
 * Given a list of aircraft data, change the altitude of the aircraft to the new altitude.
 *
 * @param aircraftData A list containing the aircraft data as tuples.
 * @param newAltitude The new altitude to set for the aircraft.
 * @return The modified aircraft data with the altitude updated.
 */
fun changeAltitude(aircraftData: MutableList<Triple<String, Float, Float>>, newAltitude: Float): MutableList<Triple<String, Float, Float>> {

    for (i in aircraftData.indices) {
        // Unpack the aircraft data tuple
        val (name, _, speed) = aircraftData[i]

        // Update the altitude to the new altitude
        // Use the unpacked data to construct the modified aircraft data tuple
        aircraftData[i] = Triple(name, newAltitude, speed)
    }

    return aircraftData
}