/**
 * Given two lists, find the common elements and return them as a pair.
 *
 * @param list1 First list of elements
 * @param list2 Second list of elements
 * @return Pair containing the common elements in both lists
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> Pair(3, 4)
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): Pair<Int, Int> {

    // Initialize an empty list to store the common elements
    val commonElements = mutableListOf<Int>()

    // Iterate through each element in list1
    for (element in list1) {
        // Check if the current element is present in list2
        if (list2.contains(element)) {
            // Add the common element to the commonElements list
            commonElements.add(element)
        }
    }

    // Create a pair using the commonElements list and return it
    return Pair(commonElements[0], commonElements[1])
}
/**
 * Given two lists, find the common elements and return them as a pair.
 *
 * @param list1 First list of elements
 * @param list2 Second list of elements
 * @return Pair containing the common elements in both lists
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> Pair(3, 4)
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): Pair<Int, Int> {
/**
 * Given two lists, find the common elements and return them as a pair.
 *
 * @param list1 First list of elements
 * @param list2 Second list of elements
 * @return Pair containing the common elements in both lists
 *
 * Example:
 * findCommonElements(listOf(1, 2, 3, 4), listOf(3, 4, 5, 6)) -> Pair(3, 4)
 */
fun findCommonElements(list1: List<Int>, list2: List<Int>): Pair<Int, Int> {

    // Initialize an empty list to store the common elements
    val commonElements = mutableListOf<Int>()

    // Iterate through each element in list1
    for (element in list1) {
        // Check if the current element is present in list2
        if (list2.contains(element)) {
            // Add the common element to the commonElements list
            commonElements.add(element)
        }
    }

    // Create a pair using the commonElements list and return it
    return Pair(commonElements[0], commonElements[1])
}