/**
 * Given a list of planets with their names, temperatures, and temperature units, find the planet
 * with the highest temperature and return its name and value as a pair.
 *
 * @param planets A list of pairs where each pair contains the name of the planet as a string, followed by a nested pair
 * of its temperature as a float and temperature unit as a string.
 * @return A pair containing the name of the planet with the highest temperature and the corresponding temperature value.
 */
fun findHighTemperature(planets: List<Pair<String, Pair<Float, String>>>) : Pair<String, Float> {

    var maxTemp = Float.NEGATIVE_INFINITY
    var maxTempPlanet = ""

    for (planet in planets) {
        val (_, tempPair) = planet
        val temp = tempPair.first
        if (temp > maxTemp) {
            maxTemp = temp
            maxTempPlanet = planet.first
        }
    }

    return Pair(maxTempPlanet, maxTemp)
}
/**
 * Given a list of planets with their names, temperatures, and temperature units, find the planet
 * with the highest temperature and return its name and value as a pair.
 *
 * @param planets A list of pairs where each pair contains the name of the planet as a string, followed by a nested pair
 * of its temperature as a float and temperature unit as a string.
 * @return A pair containing the name of the planet with the highest temperature and the corresponding temperature value.
 */
fun findHighTemperature(planets: List<Pair<String, Pair<Float, String>>>) : Pair<String, Float> {
/**
 * Given a list of planets with their names, temperatures, and temperature units, find the planet
 * with the highest temperature and return its name and value as a pair.
 *
 * @param planets A list of pairs where each pair contains the name of the planet as a string, followed by a nested pair
 * of its temperature as a float and temperature unit as a string.
 * @return A pair containing the name of the planet with the highest temperature and the corresponding temperature value.
 */
fun findHighTemperature(planets: List<Pair<String, Pair<Float, String>>>) : Pair<String, Float> {

    var maxTemp = Float.NEGATIVE_INFINITY
    var maxTempPlanet = ""

    for (planet in planets) {
        val (_, tempPair) = planet
        val temp = tempPair.first
        if (temp > maxTemp) {
            maxTemp = temp
            maxTempPlanet = planet.first
        }
    }

    return Pair(maxTempPlanet, maxTemp)
}