/**
 * Write a function that returns true if the intersection of two given lists is equal to one of the lists,
 * and false otherwise. The intersection of lists refers to the common elements present in both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return True if intersection of lists is equal to one of the lists, false otherwise.
 *
 * Example:
 * intersectionOfListsEqual(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // true
 * intersectionOfListsEqual(listOf(1, 2, 3), listOf(4, 5, 6)) // false
 */
fun intersectionOfListsEqual(list1: List<Int>, list2: List<Int>): Boolean {

    // Find the intersection of the two lists
    val intersection = list1.intersect(list2).toList()

    // Check if the intersection is equal to one of the lists
    return intersection == list1 || intersection == list2
}
/**
 * Write a function that returns true if the intersection of two given lists is equal to one of the lists,
 * and false otherwise. The intersection of lists refers to the common elements present in both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return True if intersection of lists is equal to one of the lists, false otherwise.
 *
 * Example:
 * intersectionOfListsEqual(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // true
 * intersectionOfListsEqual(listOf(1, 2, 3), listOf(4, 5, 6)) // false
 */
fun intersectionOfListsEqual(list1: List<Int>, list2: List<Int>): Boolean {
/**
 * Write a function that returns true if the intersection of two given lists is equal to one of the lists,
 * and false otherwise. The intersection of lists refers to the common elements present in both lists.
 *
 * @param list1 The first list.
 * @param list2 The second list.
 * @return True if intersection of lists is equal to one of the lists, false otherwise.
 *
 * Example:
 * intersectionOfListsEqual(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // true
 * intersectionOfListsEqual(listOf(1, 2, 3), listOf(4, 5, 6)) // false
 */
fun intersectionOfListsEqual(list1: List<Int>, list2: List<Int>): Boolean {

    // Find the intersection of the two lists
    val intersection = list1.intersect(list2).toList()

    // Check if the intersection is equal to one of the lists
    return intersection == list1 || intersection == list2
}