/**
 * Given two sets p and q, find the intersection of the two sets using an unconditioned 
 * ternary operator.
 *
 * @param p First input set.
 * @param q Second input set.
 * @return Intersection of the two input sets.
 *
 * Example:
 * intersectionExample(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // Output: setOf(3, 4)
 * intersectionExample(setOf(10, 20, 30), setOf(40, 50, 60)) // Output: emptySet()
 */
fun intersectionExample(p: Set<Int>, q: Set<Int>): Set<Int> {

    // Use an unconditioned ternary operator to find the intersection
    return if (p.size < q.size) p.filter { it in q }.toSet() else q.filter { it in p }.toSet()
}
/**
 * Given two sets p and q, find the intersection of the two sets using an unconditioned 
 * ternary operator.
 *
 * @param p First input set.
 * @param q Second input set.
 * @return Intersection of the two input sets.
 *
 * Example:
 * intersectionExample(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // Output: setOf(3, 4)
 * intersectionExample(setOf(10, 20, 30), setOf(40, 50, 60)) // Output: emptySet()
 */
fun intersectionExample(p: Set<Int>, q: Set<Int>): Set<Int> {
/**
 * Given two sets p and q, find the intersection of the two sets using an unconditioned 
 * ternary operator.
 *
 * @param p First input set.
 * @param q Second input set.
 * @return Intersection of the two input sets.
 *
 * Example:
 * intersectionExample(setOf(1, 2, 3, 4), setOf(3, 4, 5, 6)) // Output: setOf(3, 4)
 * intersectionExample(setOf(10, 20, 30), setOf(40, 50, 60)) // Output: emptySet()
 */
fun intersectionExample(p: Set<Int>, q: Set<Int>): Set<Int> {

    // Use an unconditioned ternary operator to find the intersection
    return if (p.size < q.size) p.filter { it in q }.toSet() else q.filter { it in p }.toSet()
}