/**
 * Assume there are two sets, set1 and set2, containing the elements of a civil engineering project.
 * Write a Kotlin function that takes these two sets as input and appends the common elements
 * between the sets to a list called intersectionList.
 *
 * @param set1 A set containing the elements of the civil engineering project.
 * @param set2 Another set containing the elements of the civil engineering project.
 * @return A list containing the common elements between set1 and set2.
 */
fun appendElementsLoop(set1: Set<Any>, set2: Set<Any>): List<Any> {

    // Initialize an empty list to store the common elements
    val intersectionList = mutableListOf<Any>()

    // Looping through set1 using a for loop
    for (element in set1) {
        // Check if the element is present in set2
        if (element in set2) {
            // Append the common element to the intersectionList
            intersectionList.add(element)
        }
    }

    // Return the list containing the common elements
    return intersectionList
}
/**
 * Assume there are two sets, set1 and set2, containing the elements of a civil engineering project.
 * Write a Kotlin function that takes these two sets as input and appends the common elements
 * between the sets to a list called intersectionList.
 *
 * @param set1 A set containing the elements of the civil engineering project.
 * @param set2 Another set containing the elements of the civil engineering project.
 * @return A list containing the common elements between set1 and set2.
 */
fun appendElementsLoop(set1: Set<Any>, set2: Set<Any>): List<Any> {
/**
 * Assume there are two sets, set1 and set2, containing the elements of a civil engineering project.
 * Write a Kotlin function that takes these two sets as input and appends the common elements
 * between the sets to a list called intersectionList.
 *
 * @param set1 A set containing the elements of the civil engineering project.
 * @param set2 Another set containing the elements of the civil engineering project.
 * @return A list containing the common elements between set1 and set2.
 */
fun appendElementsLoop(set1: Set<Any>, set2: Set<Any>): List<Any> {

    // Initialize an empty list to store the common elements
    val intersectionList = mutableListOf<Any>()

    // Looping through set1 using a for loop
    for (element in set1) {
        // Check if the element is present in set2
        if (element in set2) {
            // Append the common element to the intersectionList
            intersectionList.add(element)
        }
    }

    // Return the list containing the common elements
    return intersectionList
}