/**
 * This function takes a genetic sequence and a list of modifications, and updates the genetic sequence based on the modifications.
 *
 * @param geneticSequence The original genetic sequence.
 * @param modifications Each tuple in the list contains the index and the new nucleotide that needs to be modified in the genetic sequence.
 * @return The updated genetic sequence.
 */
fun updateGeneticSequence(geneticSequence: String, modifications: List<Pair<Int, Char>>): String {

    val updatedSequence = geneticSequence.toMutableList()

    for ((index, nucleotide) in modifications) {
        // Check if index is within range
        if (index >= 0 && index < updatedSequence.size) {
            updatedSequence[index] = nucleotide
        }
    }

    return updatedSequence.joinToString("")
}
/**
 * This function takes a genetic sequence and a list of modifications, and updates the genetic sequence based on the modifications.
 *
 * @param geneticSequence The original genetic sequence.
 * @param modifications Each tuple in the list contains the index and the new nucleotide that needs to be modified in the genetic sequence.
 * @return The updated genetic sequence.
 */
fun updateGeneticSequence(geneticSequence: String, modifications: List<Pair<Int, Char>>): String {
/**
 * This function takes a genetic sequence and a list of modifications, and updates the genetic sequence based on the modifications.
 *
 * @param geneticSequence The original genetic sequence.
 * @param modifications Each tuple in the list contains the index and the new nucleotide that needs to be modified in the genetic sequence.
 * @return The updated genetic sequence.
 */
fun updateGeneticSequence(geneticSequence: String, modifications: List<Pair<Int, Char>>): String {

    val updatedSequence = geneticSequence.toMutableList()

    for ((index, nucleotide) in modifications) {
        // Check if index is within range
        if (index >= 0 && index < updatedSequence.size) {
            updatedSequence[index] = nucleotide
        }
    }

    return updatedSequence.joinToString("")
}