/**
 * The function takes in two lists and returns a pair containing the common elements of the lists.
 *
 * @param list1 First input list
 * @param list2 Second input list
 * @return Pair containing common elements of the lists
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // Output: Pair(3, 4)
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): Pair<Int, Int>? {

    val commonElements = list1.toSet() intersect list2.toSet()
    return if (commonElements.isNotEmpty()) commonElements.first() to commonElements.last() else null
}
/**
 * The function takes in two lists and returns a pair containing the common elements of the lists.
 *
 * @param list1 First input list
 * @param list2 Second input list
 * @return Pair containing common elements of the lists
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // Output: Pair(3, 4)
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): Pair<Int, Int>? {
/**
 * The function takes in two lists and returns a pair containing the common elements of the lists.
 *
 * @param list1 First input list
 * @param list2 Second input list
 * @return Pair containing common elements of the lists
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) // Output: Pair(3, 4)
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): Pair<Int, Int>? {

    val commonElements = list1.toSet() intersect list2.toSet()
    return if (commonElements.isNotEmpty()) commonElements.first() to commonElements.last() else null
}