/**
 * Given a DNA sequence and an index, return the number of mutations in the sequence up to the given index.
 */
fun countMutations(sequence: String, index: Int): Int {

    var mutationCount = 0

    for (i in 0 until index) {
        val base = sequence[i]

        if (base != 'A' && base != 'T' && base != 'C' && base != 'G') {
            mutationCount++
        }
    }

    return mutationCount
}
/**
 * Given a DNA sequence and an index, return the number of mutations in the sequence up to the given index.
 */
fun countMutations(sequence: String, index: Int): Int {
/**
 * Given a DNA sequence and an index, return the number of mutations in the sequence up to the given index.
 */
fun countMutations(sequence: String, index: Int): Int {

    var mutationCount = 0

    for (i in 0 until index) {
        val base = sequence[i]

        if (base != 'A' && base != 'T' && base != 'C' && base != 'G') {
            mutationCount++
        }
    }

    return mutationCount
}