/**
 * This exercise requires finding the intersection between two lists, using list comprehension and
 * considering only the elements that are less than a given value.
 *
 * @param nums1 The first list of numbers.
 * @param nums2 The second list of numbers.
 * @param n The value to compare against.
 * @return A list containing the intersection of nums1 and nums2 where all elements are less than n.
 */
fun intersectionLessThan(nums1: List<Int>, nums2: List<Int>, n: Int): List<Int> {

    // Original lists
    val list1 = listOf(14, 6, 9, 3, 11, 2)
    val list2 = listOf(3, 18, 5, 12, 7, 9)

    // Find the intersection using list comprehension
    val intersectionNums = nums1.filter { num1 -> nums2.any { num2 -> num1 == num2 } }

    // Filter the elements that are less than n
    val filteredNums = intersectionNums.filter { num -> num < n }

    return filteredNums
}
/**
 * This exercise requires finding the intersection between two lists, using list comprehension and
 * considering only the elements that are less than a given value.
 *
 * @param nums1 The first list of numbers.
 * @param nums2 The second list of numbers.
 * @param n The value to compare against.
 * @return A list containing the intersection of nums1 and nums2 where all elements are less than n.
 */
fun intersectionLessThan(nums1: List<Int>, nums2: List<Int>, n: Int): List<Int> {
/**
 * This exercise requires finding the intersection between two lists, using list comprehension and
 * considering only the elements that are less than a given value.
 *
 * @param nums1 The first list of numbers.
 * @param nums2 The second list of numbers.
 * @param n The value to compare against.
 * @return A list containing the intersection of nums1 and nums2 where all elements are less than n.
 */
fun intersectionLessThan(nums1: List<Int>, nums2: List<Int>, n: Int): List<Int> {

    // Original lists
    val list1 = listOf(14, 6, 9, 3, 11, 2)
    val list2 = listOf(3, 18, 5, 12, 7, 9)

    // Find the intersection using list comprehension
    val intersectionNums = nums1.filter { num1 -> nums2.any { num2 -> num1 == num2 } }

    // Filter the elements that are less than n
    val filteredNums = intersectionNums.filter { num -> num < n }

    return filteredNums
}