/**
 * Given a list of dancers, remove any duplicates and return a new list.
 *
 * @param dancers list of dancers (tuple of name, age, gender)
 * @return list of dancers without duplicates
 *
 * Example:
 * removeDuplicates(listOf("John" to 25, "Male", "Maria" to 30, "Female", "John" to 25, "Male", "Peter" to 35, "Male"))
 * Output: listOf("John" to 25, "Male", "Maria" to 30, "Female", "Peter" to 35, "Male")
 */
fun removeDuplicates(dancers: List<Triple<String, Int, String>>): List<Triple<String, Int, String>> {

    // Create a set to store unique dancers
    val uniqueDancers = mutableSetOf<Triple<String, Int, String>>()

    // Iterate over each dancer in the input list
    for (dancer in dancers) {
        // Check if the current dancer is already in the set
        if (dancer !in uniqueDancers) {
            // If not, add the dancer to the set
            uniqueDancers.add(dancer)
        }
    }

    // Return the set converted back to a list without duplicates
    return uniqueDancers.toList()
}
/**
 * Given a list of dancers, remove any duplicates and return a new list.
 *
 * @param dancers list of dancers (tuple of name, age, gender)
 * @return list of dancers without duplicates
 *
 * Example:
 * removeDuplicates(listOf("John" to 25, "Male", "Maria" to 30, "Female", "John" to 25, "Male", "Peter" to 35, "Male"))
 * Output: listOf("John" to 25, "Male", "Maria" to 30, "Female", "Peter" to 35, "Male")
 */
fun removeDuplicates(dancers: List<Triple<String, Int, String>>): List<Triple<String, Int, String>> {
/**
 * Given a list of dancers, remove any duplicates and return a new list.
 *
 * @param dancers list of dancers (tuple of name, age, gender)
 * @return list of dancers without duplicates
 *
 * Example:
 * removeDuplicates(listOf("John" to 25, "Male", "Maria" to 30, "Female", "John" to 25, "Male", "Peter" to 35, "Male"))
 * Output: listOf("John" to 25, "Male", "Maria" to 30, "Female", "Peter" to 35, "Male")
 */
fun removeDuplicates(dancers: List<Triple<String, Int, String>>): List<Triple<String, Int, String>> {

    // Create a set to store unique dancers
    val uniqueDancers = mutableSetOf<Triple<String, Int, String>>()

    // Iterate over each dancer in the input list
    for (dancer in dancers) {
        // Check if the current dancer is already in the set
        if (dancer !in uniqueDancers) {
            // If not, add the dancer to the set
            uniqueDancers.add(dancer)
        }
    }

    // Return the set converted back to a list without duplicates
    return uniqueDancers.toList()
}