/**
 * Given a set and a list, this function returns a new list that contains all the unique elements
 * of the set followed by all the unique elements of the list, excluding any duplicates. The order
 * of the elements should be preserved.
 *
 * @param set1 A set of elements.
 * @param list1 A list of elements.
 * @return A new list containing all the unique elements of the set and the list, without duplicates.
 *
 * Example:
 * createUniqueList(setOf(1, 2, 3), listOf(2, 3, 4)) // [1, 2, 3, 4]
 */
fun createUniqueList(set1: Set<Int>, list1: List<Int>): List<Int> {

    val uniqueElements = set1.union(list1.toSet())
    return uniqueElements.toList()
}
/**
 * Given a set and a list, this function returns a new list that contains all the unique elements
 * of the set followed by all the unique elements of the list, excluding any duplicates. The order
 * of the elements should be preserved.
 *
 * @param set1 A set of elements.
 * @param list1 A list of elements.
 * @return A new list containing all the unique elements of the set and the list, without duplicates.
 *
 * Example:
 * createUniqueList(setOf(1, 2, 3), listOf(2, 3, 4)) // [1, 2, 3, 4]
 */
fun createUniqueList(set1: Set<Int>, list1: List<Int>): List<Int> {
/**
 * Given a set and a list, this function returns a new list that contains all the unique elements
 * of the set followed by all the unique elements of the list, excluding any duplicates. The order
 * of the elements should be preserved.
 *
 * @param set1 A set of elements.
 * @param list1 A list of elements.
 * @return A new list containing all the unique elements of the set and the list, without duplicates.
 *
 * Example:
 * createUniqueList(setOf(1, 2, 3), listOf(2, 3, 4)) // [1, 2, 3, 4]
 */
fun createUniqueList(set1: Set<Int>, list1: List<Int>): List<Int> {

    val uniqueElements = set1.union(list1.toSet())
    return uniqueElements.toList()
}