/**
 * This function takes a set of actors and a tuple containing the actor's name, age, and gender
 * and adds the actor to the set using the tuple() function. The actor's name should be the first
 * element in the tuple.
 *
 * @param actorSet A set containing actors.
 * @param actorTuple A tuple containing the actor's name, age, and gender.
 * @return The updated set with the actor added.
 */
fun addActorToSet(actorSet: MutableSet<Triple<String, Int, String>>, actorTuple: Triple<String, Int, String>): MutableSet<Triple<String, Int, String>> {

    // Extract the actor's name from the tuple
    val actorName = actorTuple.first

    // Create a new tuple with the actor's name as the first element
    val newActorTuple = Triple(actorName, actorTuple.second, actorTuple.third)

    // Add the new tuple to the set
    actorSet.add(newActorTuple)

    return actorSet
}

// Example usage
val actors = mutableSetOf(
    Triple("Tom Hanks", 64, "Male"),
    Triple("Meryl Streep", 71, "Female"),
    Triple("Leonardo DiCaprio", 46, "Male")
)
val newActor = Triple("Emma Stone", 32, "Female")
/**
 * This function takes a set of actors and a tuple containing the actor's name, age, and gender
 * and adds the actor to the set using the tuple() function. The actor's name should be the first
 * element in the tuple.
 *
 * @param actorSet A set containing actors.
 * @param actorTuple A tuple containing the actor's name, age, and gender.
 * @return The updated set with the actor added.
 */
fun addActorToSet(actorSet: MutableSet<Triple<String, Int, String>>, actorTuple: Triple<String, Int, String>): MutableSet<Triple<String, Int, String>> {
/**
 * This function takes a set of actors and a tuple containing the actor's name, age, and gender
 * and adds the actor to the set using the tuple() function. The actor's name should be the first
 * element in the tuple.
 *
 * @param actorSet A set containing actors.
 * @param actorTuple A tuple containing the actor's name, age, and gender.
 * @return The updated set with the actor added.
 */
fun addActorToSet(actorSet: MutableSet<Triple<String, Int, String>>, actorTuple: Triple<String, Int, String>): MutableSet<Triple<String, Int, String>> {

    // Extract the actor's name from the tuple
    val actorName = actorTuple.first

    // Create a new tuple with the actor's name as the first element
    val newActorTuple = Triple(actorName, actorTuple.second, actorTuple.third)

    // Add the new tuple to the set
    actorSet.add(newActorTuple)

    return actorSet
}

// Example usage
val actors = mutableSetOf(
    Triple("Tom Hanks", 64, "Male"),
    Triple("Meryl Streep", 71, "Female"),
    Triple("Leonardo DiCaprio", 46, "Male")
)
val newActor = Triple("Emma Stone", 32, "Female")