/**
 * The function takes a list of gene sequences as input. It iterates through the list and checks for a certain pattern
 * in the genes. If the pattern is found, it prints the gene sequence along with the position of the pattern in the gene.
 * The function returns the count of the number of genes that contain the pattern.
 *
 * @param geneList A list of gene sequences.
 * @return The count of genes that contain the pattern.
 */
fun geneAnalysis(geneList: List<String>): Int {

    val pattern = "ATGC"
    var count = 0

    for ((geneIndex, gene) in geneList.withIndex()) {
        val geneLength = gene.length

        // Nested loop to check for the pattern in the gene
        for (i in 0 until geneLength - pattern.length + 1) {
            if (gene.substring(i, i + pattern.length) == pattern) {
                println("Gene sequence: $gene | Position: $i")
                count++
            }
        }
    }

    return count
}
/**
 * The function takes a list of gene sequences as input. It iterates through the list and checks for a certain pattern
 * in the genes. If the pattern is found, it prints the gene sequence along with the position of the pattern in the gene.
 * The function returns the count of the number of genes that contain the pattern.
 *
 * @param geneList A list of gene sequences.
 * @return The count of genes that contain the pattern.
 */
fun geneAnalysis(geneList: List<String>): Int {
/**
 * The function takes a list of gene sequences as input. It iterates through the list and checks for a certain pattern
 * in the genes. If the pattern is found, it prints the gene sequence along with the position of the pattern in the gene.
 * The function returns the count of the number of genes that contain the pattern.
 *
 * @param geneList A list of gene sequences.
 * @return The count of genes that contain the pattern.
 */
fun geneAnalysis(geneList: List<String>): Int {

    val pattern = "ATGC"
    var count = 0

    for ((geneIndex, gene) in geneList.withIndex()) {
        val geneLength = gene.length

        // Nested loop to check for the pattern in the gene
        for (i in 0 until geneLength - pattern.length + 1) {
            if (gene.substring(i, i + pattern.length) == pattern) {
                println("Gene sequence: $gene | Position: $i")
                count++
            }
        }
    }

    return count
}