/**
 * This function takes in two lists of genes (represented as pairs) and returns a new list
 * containing the common genes between the two lists.
 *
 * @param geneList1 List of genes (represented as pairs) from organism A.
 * @param geneList2 List of genes (represented as pairs) from organism B.
 * @return List of genes (represented as pairs) that are common between organism A and B.
 */
fun findCommonGenes(geneList1: List<Pair<String, String>>, geneList2: List<Pair<String, String>>): List<Pair<String, String>> {

    val commonGenes = mutableListOf<Pair<String, String>>()

    // Check each gene in geneList1
    for (gene1 in geneList1) {
        // Check each gene in geneList2
        for (gene2 in geneList2) {
            // Check if the gene name and protein sequence are the same for both genes
            if (gene1.first == gene2.first && gene1.second == gene2.second) {
                // Add the common gene to the commonGenes list
                commonGenes.add(gene1)
            }
        }
    }

    return commonGenes
}
/**
 * This function takes in two lists of genes (represented as pairs) and returns a new list
 * containing the common genes between the two lists.
 *
 * @param geneList1 List of genes (represented as pairs) from organism A.
 * @param geneList2 List of genes (represented as pairs) from organism B.
 * @return List of genes (represented as pairs) that are common between organism A and B.
 */
fun findCommonGenes(geneList1: List<Pair<String, String>>, geneList2: List<Pair<String, String>>): List<Pair<String, String>> {
/**
 * This function takes in two lists of genes (represented as pairs) and returns a new list
 * containing the common genes between the two lists.
 *
 * @param geneList1 List of genes (represented as pairs) from organism A.
 * @param geneList2 List of genes (represented as pairs) from organism B.
 * @return List of genes (represented as pairs) that are common between organism A and B.
 */
fun findCommonGenes(geneList1: List<Pair<String, String>>, geneList2: List<Pair<String, String>>): List<Pair<String, String>> {

    val commonGenes = mutableListOf<Pair<String, String>>()

    // Check each gene in geneList1
    for (gene1 in geneList1) {
        // Check each gene in geneList2
        for (gene2 in geneList2) {
            // Check if the gene name and protein sequence are the same for both genes
            if (gene1.first == gene2.first && gene1.second == gene2.second) {
                // Add the common gene to the commonGenes list
                commonGenes.add(gene1)
            }
        }
    }

    return commonGenes
}