/**
 * Given two lists of integers, nums1 and nums2, find the intersection of the two lists.
 * The intersection is a list of numbers that appear in both lists.
 *
 * @param nums1 List of integers representing the first list
 * @param nums2 List of integers representing the second list
 * @return List of integers, the intersection of nums1 and nums2
 *
 * Example:
 * findIntersection(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> [3, 4]
 * findIntersection(listOf(9, 8, 7, 6), listOf(0, 5, 1, 3)) -> []
 */
fun findIntersection(nums1: List<Int>, nums2: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()

    // Iterate over each element in nums1
    for (num in nums1) {
        // Check if the element is also present in nums2
        if (num in nums2) {
            intersection.add(num)
        }
    }

    return intersection
}
/**
 * Given two lists of integers, nums1 and nums2, find the intersection of the two lists.
 * The intersection is a list of numbers that appear in both lists.
 *
 * @param nums1 List of integers representing the first list
 * @param nums2 List of integers representing the second list
 * @return List of integers, the intersection of nums1 and nums2
 *
 * Example:
 * findIntersection(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> [3, 4]
 * findIntersection(listOf(9, 8, 7, 6), listOf(0, 5, 1, 3)) -> []
 */
fun findIntersection(nums1: List<Int>, nums2: List<Int>): List<Int> {
/**
 * Given two lists of integers, nums1 and nums2, find the intersection of the two lists.
 * The intersection is a list of numbers that appear in both lists.
 *
 * @param nums1 List of integers representing the first list
 * @param nums2 List of integers representing the second list
 * @return List of integers, the intersection of nums1 and nums2
 *
 * Example:
 * findIntersection(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> [3, 4]
 * findIntersection(listOf(9, 8, 7, 6), listOf(0, 5, 1, 3)) -> []
 */
fun findIntersection(nums1: List<Int>, nums2: List<Int>): List<Int> {

    val intersection = mutableListOf<Int>()

    // Iterate over each element in nums1
    for (num in nums1) {
        // Check if the element is also present in nums2
        if (num in nums2) {
            intersection.add(num)
        }
    }

    return intersection
}