/**
 * Given a list of tuples representing the profit of different companies,
 * return the name of the company with the highest absolute profit value.
 *
 * @param profitData List<Pair<String, Float, Float>> A list of tuples containing the company name,
 * the profit for the current year, and the profit for the previous year.
 * @return String The name of the company with the highest absolute profit value.
 */
fun calculateProfit(profitData: List<Triple<String, Float, Float>>): String {

    var maxProfit = Float.NEGATIVE_INFINITY
    var maxProfitCompany: String? = null

    for ((company, currentProfit, previousProfit) in profitData) {
        val absoluteProfit = Math.abs(currentProfit - previousProfit)
        if (absoluteProfit > maxProfit) {
            maxProfit = absoluteProfit
            maxProfitCompany = company
        }
    }

    return maxProfitCompany ?: ""
}
/**
 * Given a list of tuples representing the profit of different companies,
 * return the name of the company with the highest absolute profit value.
 *
 * @param profitData List<Pair<String, Float, Float>> A list of tuples containing the company name,
 * the profit for the current year, and the profit for the previous year.
 * @return String The name of the company with the highest absolute profit value.
 */
fun calculateProfit(profitData: List<Triple<String, Float, Float>>): String {
/**
 * Given a list of tuples representing the profit of different companies,
 * return the name of the company with the highest absolute profit value.
 *
 * @param profitData List<Pair<String, Float, Float>> A list of tuples containing the company name,
 * the profit for the current year, and the profit for the previous year.
 * @return String The name of the company with the highest absolute profit value.
 */
fun calculateProfit(profitData: List<Triple<String, Float, Float>>): String {

    var maxProfit = Float.NEGATIVE_INFINITY
    var maxProfitCompany: String? = null

    for ((company, currentProfit, previousProfit) in profitData) {
        val absoluteProfit = Math.abs(currentProfit - previousProfit)
        if (absoluteProfit > maxProfit) {
            maxProfit = absoluteProfit
            maxProfitCompany = company
        }
    }

    return maxProfitCompany ?: ""
}