/**
 * This function takes two sets as input and finds the intersection of the sets using the 'in' operator and set creation.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return The intersection of set1 and set2.
 *
 * Example:
 * intersectionOfInOperatorAndCreatingASet(setOf(1, 2, 3), setOf(2, 3, 4)) // Output: setOf(2, 3)
 */
fun intersectionOfInOperatorAndCreatingASet(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    // Initialize an empty set to store the intersection
    val intersectionSet = mutableSetOf<Int>()

    // Iterate over elements in set1
    for (element in set1) {
        // Check if the element is present in set2
        if (element in set2) {
            // Add the element to the intersection set
            intersectionSet.add(element)
        }
    }

    return intersectionSet
}
/**
 * This function takes two sets as input and finds the intersection of the sets using the 'in' operator and set creation.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return The intersection of set1 and set2.
 *
 * Example:
 * intersectionOfInOperatorAndCreatingASet(setOf(1, 2, 3), setOf(2, 3, 4)) // Output: setOf(2, 3)
 */
fun intersectionOfInOperatorAndCreatingASet(set1: Set<Int>, set2: Set<Int>): Set<Int> {
/**
 * This function takes two sets as input and finds the intersection of the sets using the 'in' operator and set creation.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return The intersection of set1 and set2.
 *
 * Example:
 * intersectionOfInOperatorAndCreatingASet(setOf(1, 2, 3), setOf(2, 3, 4)) // Output: setOf(2, 3)
 */
fun intersectionOfInOperatorAndCreatingASet(set1: Set<Int>, set2: Set<Int>): Set<Int> {

    // Initialize an empty set to store the intersection
    val intersectionSet = mutableSetOf<Int>()

    // Iterate over elements in set1
    for (element in set1) {
        // Check if the element is present in set2
        if (element in set2) {
            // Add the element to the intersection set
            intersectionSet.add(element)
        }
    }

    return intersectionSet
}