/**
 * Given a list of actresses and an actor's salary, find the best actor who is willing to work within the given budget.
 *
 * @param actressesList A list of tuples containing actress name, their annual salary, and their level of experience.
 * @param actorSalary The budget available for the actor's annual salary.
 * @return The name of the best actor who is within the given budget.
 */
fun findBestActor(actressesList: List<Triple<String, Double, Int>>, actorSalary: Double): String? {

    var bestActor: String? = null
    var bestExperience = Double.POSITIVE_INFINITY

    for (actressInfo in actressesList) {
        val (actressName, actressSalary, actressExperience) = actressInfo

        if (actressSalary > actorSalary) {
            continue
        }

        if (actressExperience < bestExperience) {
            bestActor = actressName
            bestExperience = actressExperience.toDouble()
        }
    }

    return bestActor
}
/**
 * Given a list of actresses and an actor's salary, find the best actor who is willing to work within the given budget.
 *
 * @param actressesList A list of tuples containing actress name, their annual salary, and their level of experience.
 * @param actorSalary The budget available for the actor's annual salary.
 * @return The name of the best actor who is within the given budget.
 */
fun findBestActor(actressesList: List<Triple<String, Double, Int>>, actorSalary: Double): String? {
/**
 * Given a list of actresses and an actor's salary, find the best actor who is willing to work within the given budget.
 *
 * @param actressesList A list of tuples containing actress name, their annual salary, and their level of experience.
 * @param actorSalary The budget available for the actor's annual salary.
 * @return The name of the best actor who is within the given budget.
 */
fun findBestActor(actressesList: List<Triple<String, Double, Int>>, actorSalary: Double): String? {

    var bestActor: String? = null
    var bestExperience = Double.POSITIVE_INFINITY

    for (actressInfo in actressesList) {
        val (actressName, actressSalary, actressExperience) = actressInfo

        if (actressSalary > actorSalary) {
            continue
        }

        if (actressExperience < bestExperience) {
            bestActor = actressName
            bestExperience = actressExperience.toDouble()
        }
    }

    return bestActor
}