/**
 * Find the intersection of two sets while considering the presence of null in conditional statements.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return Intersection of the two sets excluding null elements.
 *
 * Example:
 * '``
 * val set1 = setOf(1, 2, 3, null, 7)
 * val set2 = setOf(2, 3, 4, null, 5)
 * println(intersectionOfNoneAndSets(set1, set2)) // Output: [2, 3]
 * '``
 */
fun intersectionOfNoneAndSets(set1: Set<Any?>, set2: Set<Any?>): Set<Any?> {

    val intersection = mutableSetOf<Any?>()

    // Iterate over set1 and check for intersection considering null elements too
    for (element in set1) {
        if (element != null && (element in set2 || null in set2)) {
            intersection.add(element)
        }
    }

    return intersection
}
/**
 * Find the intersection of two sets while considering the presence of null in conditional statements.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return Intersection of the two sets excluding null elements.
 *
 * Example:
 * '``
 * val set1 = setOf(1, 2, 3, null, 7)
 * val set2 = setOf(2, 3, 4, null, 5)
 * println(intersectionOfNoneAndSets(set1, set2)) // Output: [2, 3]
 * '``
 */
fun intersectionOfNoneAndSets(set1: Set<Any?>, set2: Set<Any?>): Set<Any?> {
/**
 * Find the intersection of two sets while considering the presence of null in conditional statements.
 *
 * @param set1 The first set.
 * @param set2 The second set.
 * @return Intersection of the two sets excluding null elements.
 *
 * Example:
 * '``
 * val set1 = setOf(1, 2, 3, null, 7)
 * val set2 = setOf(2, 3, 4, null, 5)
 * println(intersectionOfNoneAndSets(set1, set2)) // Output: [2, 3]
 * '``
 */
fun intersectionOfNoneAndSets(set1: Set<Any?>, set2: Set<Any?>): Set<Any?> {

    val intersection = mutableSetOf<Any?>()

    // Iterate over set1 and check for intersection considering null elements too
    for (element in set1) {
        if (element != null && (element in set2 || null in set2)) {
            intersection.add(element)
        }
    }

    return intersection
}