/**
 * This function finds the common elements between a list of tuples and an array.
 *
 * @param tupleList A list of tuples.
 * @param arrayList An array of integers.
 * @return A list of common elements.
 */
fun commonElements(tupleList: List<Pair<Int, Int>>, arrayList: List<Int>): List<Int> {

    val common = mutableListOf<Int>()
    for (tuple in tupleList) {
        for (element in tuple.toList()) {
            if (element in arrayList) {
                common.add(element)
            }
        }
    }
    return common
}
/**
 * This function finds the common elements between a list of tuples and an array.
 *
 * @param tupleList A list of tuples.
 * @param arrayList An array of integers.
 * @return A list of common elements.
 */
fun commonElements(tupleList: List<Pair<Int, Int>>, arrayList: List<Int>): List<Int> {
/**
 * This function finds the common elements between a list of tuples and an array.
 *
 * @param tupleList A list of tuples.
 * @param arrayList An array of integers.
 * @return A list of common elements.
 */
fun commonElements(tupleList: List<Pair<Int, Int>>, arrayList: List<Int>): List<Int> {

    val common = mutableListOf<Int>()
    for (tuple in tupleList) {
        for (element in tuple.toList()) {
            if (element in arrayList) {
                common.add(element)
            }
        }
    }
    return common
}