/**
 * This function concatenates two lists together and returns a new list without any duplicate elements.
 *
 * @param list1 The first list to be concatenated.
 * @param list2 The second list to be concatenated.
 * @return A new list containing all the elements from the two input lists without any duplicates.
 */
fun concatenateLists(list1: List<Any>, list2: List<Any>): List<Any> {

    // Step 1: Define an empty list to store the concatenated elements
    val concatenatedList = mutableListOf<Any>()

    // Step 2: Create a set from the concatenation of list1 and list2 to remove any duplicates
    val uniqueElements = (list1 + list2).toSet()

    // Step 3: Iterate through the unique elements set and append each element to the concatenated list
    for (element in uniqueElements) {
        concatenatedList.add(element)
    }

    // Step 4: Return the concatenated list
    return concatenatedList
}
/**
 * This function concatenates two lists together and returns a new list without any duplicate elements.
 *
 * @param list1 The first list to be concatenated.
 * @param list2 The second list to be concatenated.
 * @return A new list containing all the elements from the two input lists without any duplicates.
 */
fun concatenateLists(list1: List<Any>, list2: List<Any>): List<Any> {
/**
 * This function concatenates two lists together and returns a new list without any duplicate elements.
 *
 * @param list1 The first list to be concatenated.
 * @param list2 The second list to be concatenated.
 * @return A new list containing all the elements from the two input lists without any duplicates.
 */
fun concatenateLists(list1: List<Any>, list2: List<Any>): List<Any> {

    // Step 1: Define an empty list to store the concatenated elements
    val concatenatedList = mutableListOf<Any>()

    // Step 2: Create a set from the concatenation of list1 and list2 to remove any duplicates
    val uniqueElements = (list1 + list2).toSet()

    // Step 3: Iterate through the unique elements set and append each element to the concatenated list
    for (element in uniqueElements) {
        concatenatedList.add(element)
    }

    // Step 4: Return the concatenated list
    return concatenatedList
}