/**
 * Given two sets, find the common elements between them using a for loop.
 */
fun intersectionOfSetsWithForLoop(set1: Set<Any>, set2: Set<Any>): List<Any> {

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

    // Loop through each element in set1
    for (element in set1) {
        // Check if the element is also present in set2
        if (element in set2) {
            // Append the common element to the list
            commonElements.add(element)
        }
    }

    // Return the list of common elements
    return commonElements
}
/**
 * Given two sets, find the common elements between them using a for loop.
 */
fun intersectionOfSetsWithForLoop(set1: Set<Any>, set2: Set<Any>): List<Any> {
/**
 * Given two sets, find the common elements between them using a for loop.
 */
fun intersectionOfSetsWithForLoop(set1: Set<Any>, set2: Set<Any>): List<Any> {

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

    // Loop through each element in set1
    for (element in set1) {
        // Check if the element is also present in set2
        if (element in set2) {
            // Append the common element to the list
            commonElements.add(element)
        }
    }

    // Return the list of common elements
    return commonElements
}