/**
 * Given two DNA sequences, return a string containing only the nucleotides that are common to both sequences.
 *
 * @param dna1 a string representing the first DNA sequence
 * @param dna2 a string representing the second DNA sequence
 * @return a string with the common nucleotides between the two sequences
 */
fun createDnaSequence(dna1: String, dna2: String): String {

    var intersection = ""

    for (nucleotide in dna1) {
        if (nucleotide in dna2 && nucleotide !in intersection) {
            intersection += nucleotide
        }
    }

    return intersection
}

// Example usage
/**
 * Given two DNA sequences, return a string containing only the nucleotides that are common to both sequences.
 *
 * @param dna1 a string representing the first DNA sequence
 * @param dna2 a string representing the second DNA sequence
 * @return a string with the common nucleotides between the two sequences
 */
fun createDnaSequence(dna1: String, dna2: String): String {
/**
 * Given two DNA sequences, return a string containing only the nucleotides that are common to both sequences.
 *
 * @param dna1 a string representing the first DNA sequence
 * @param dna2 a string representing the second DNA sequence
 * @return a string with the common nucleotides between the two sequences
 */
fun createDnaSequence(dna1: String, dna2: String): String {

    var intersection = ""

    for (nucleotide in dna1) {
        if (nucleotide in dna2 && nucleotide !in intersection) {
            intersection += nucleotide
        }
    }

    return intersection
}

// Example usage