/**
 * Given two lists data1 and data2, find the intersection of the sets formed by converting them to sets.
 * Return the intersection set as a list.
 *
 * Example:
 * data1 = [1, 2, 3, 4]
 * data2 = [3, 4, 5, 6]
 *
 * intersectionOfSets(data1, data2) -> [3, 4]
 */
fun intersectionOfSets(data1: List<Int>, data2: List<Int>): List<Int> {

    val intersection = (data1.toSet() intersect data2.toSet()).toList()
    return intersection
}
/**
 * Given two lists data1 and data2, find the intersection of the sets formed by converting them to sets.
 * Return the intersection set as a list.
 *
 * Example:
 * data1 = [1, 2, 3, 4]
 * data2 = [3, 4, 5, 6]
 *
 * intersectionOfSets(data1, data2) -> [3, 4]
 */
fun intersectionOfSets(data1: List<Int>, data2: List<Int>): List<Int> {
/**
 * Given two lists data1 and data2, find the intersection of the sets formed by converting them to sets.
 * Return the intersection set as a list.
 *
 * Example:
 * data1 = [1, 2, 3, 4]
 * data2 = [3, 4, 5, 6]
 *
 * intersectionOfSets(data1, data2) -> [3, 4]
 */
fun intersectionOfSets(data1: List<Int>, data2: List<Int>): List<Int> {

    val intersection = (data1.toSet() intersect data2.toSet()).toList()
    return intersection
}