/**
 * Given a genome and a list of elements to delete, delete all occurrences of those elements from the genome.
 *
 * @param genome The genome sequence.
 * @param toDelete A list of elements to delete from the genome.
 * @return Updated genome sequence after deleting specified elements.
 */
fun deleteElements(genome: String, toDelete: List<String>): String {

    var updatedGenome = genome
    for (element in toDelete) {
        while (element in updatedGenome) {
            val index = updatedGenome.indexOf(element)
            updatedGenome = updatedGenome.substring(0, index) + updatedGenome.substring(index + element.length)
        }
    }
    return updatedGenome
}
/**
 * Given a genome and a list of elements to delete, delete all occurrences of those elements from the genome.
 *
 * @param genome The genome sequence.
 * @param toDelete A list of elements to delete from the genome.
 * @return Updated genome sequence after deleting specified elements.
 */
fun deleteElements(genome: String, toDelete: List<String>): String {
/**
 * Given a genome and a list of elements to delete, delete all occurrences of those elements from the genome.
 *
 * @param genome The genome sequence.
 * @param toDelete A list of elements to delete from the genome.
 * @return Updated genome sequence after deleting specified elements.
 */
fun deleteElements(genome: String, toDelete: List<String>): String {

    var updatedGenome = genome
    for (element in toDelete) {
        while (element in updatedGenome) {
            val index = updatedGenome.indexOf(element)
            updatedGenome = updatedGenome.substring(0, index) + updatedGenome.substring(index + element.length)
        }
    }
    return updatedGenome
}