/**
 * Given two sets of genes, find their intersection.
 *
 * @param geneSet1 A set of genes.
 * @param geneSet2 Another set of genes.
 * @return A set containing genes common to both input sets.
 */
fun obtainCommonGenes(geneSet1: Set<String>, geneSet2: Set<String>): Set<String> {

    val commonGenes = mutableSetOf<String>()

    // Iterate over first gene set
    for (gene in geneSet1) {
        // Check if gene is present in the second gene set
        if (gene in geneSet2) {
            // Check if the length of the gene is even
            if (gene.length % 2 == 0) {
                // Check if the gene starts with the letter 'A'
                if (gene.startsWith('A')) {
                    // Check if the last letter of the gene is 'T'
                    if (gene.endsWith('T')) {
                        // Add the gene to the set of common genes
                        commonGenes.add(gene)
                    }
                }
            }
        }
    }

    return commonGenes
}
/**
 * Given two sets of genes, find their intersection.
 *
 * @param geneSet1 A set of genes.
 * @param geneSet2 Another set of genes.
 * @return A set containing genes common to both input sets.
 */
fun obtainCommonGenes(geneSet1: Set<String>, geneSet2: Set<String>): Set<String> {
/**
 * Given two sets of genes, find their intersection.
 *
 * @param geneSet1 A set of genes.
 * @param geneSet2 Another set of genes.
 * @return A set containing genes common to both input sets.
 */
fun obtainCommonGenes(geneSet1: Set<String>, geneSet2: Set<String>): Set<String> {

    val commonGenes = mutableSetOf<String>()

    // Iterate over first gene set
    for (gene in geneSet1) {
        // Check if gene is present in the second gene set
        if (gene in geneSet2) {
            // Check if the length of the gene is even
            if (gene.length % 2 == 0) {
                // Check if the gene starts with the letter 'A'
                if (gene.startsWith('A')) {
                    // Check if the last letter of the gene is 'T'
                    if (gene.endsWith('T')) {
                        // Add the gene to the set of common genes
                        commonGenes.add(gene)
                    }
                }
            }
        }
    }

    return commonGenes
}