/**
 * Given two lists [nums1] and [nums2], this function returns a set containing all the elements that are present in both lists.
 *
 * @param nums1 The first list of numbers.
 * @param nums2 The second list of numbers.
 * @return The set of elements that are present in both lists.
 */
fun findIntersection(nums1: List<Int>, nums2: List<Int>): Set<Int> {

    // Create an empty set to store the intersection
    val intersection = mutableSetOf<Int>()
    
    // Iterate over each element in the first list
    for (num in nums1) {
        // Check if the element is also present in the second list
        if (num in nums2) {
            // Add the element to the intersection set
            intersection.add(num)
        }
    }
    
    // Return the intersection set
    return intersection
}
/**
 * Given two lists [nums1] and [nums2], this function returns a set containing all the elements that are present in both lists.
 *
 * @param nums1 The first list of numbers.
 * @param nums2 The second list of numbers.
 * @return The set of elements that are present in both lists.
 */
fun findIntersection(nums1: List<Int>, nums2: List<Int>): Set<Int> {
/**
 * Given two lists [nums1] and [nums2], this function returns a set containing all the elements that are present in both lists.
 *
 * @param nums1 The first list of numbers.
 * @param nums2 The second list of numbers.
 * @return The set of elements that are present in both lists.
 */
fun findIntersection(nums1: List<Int>, nums2: List<Int>): Set<Int> {

    // Create an empty set to store the intersection
    val intersection = mutableSetOf<Int>()
    
    // Iterate over each element in the first list
    for (num in nums1) {
        // Check if the element is also present in the second list
        if (num in nums2) {
            // Add the element to the intersection set
            intersection.add(num)
        }
    }
    
    // Return the intersection set
    return intersection
}