/**
 * Given a list of codons and a codon as input, return the position(s) of the codon in the list.
 *
 * @param codonList A list of codons.
 * @param codon A codon to search for in the list.
 * @return A list of integers representing the position(s) of the codon in the list.
 *
 * Example:
 * get_codon_position(listOf("AUG", "UCA", "UAA", "AGU", "UCA", "UGA"), "UCA") // [1, 4]
 * get_codon_position(listOf("AUG", "UCA", "UAA", "AGU", "UCA", "UGA"), "UGG") // []
 */
fun get_codon_position(codonList: List<String>, codon: String): List<Int> {

    val positions = mutableListOf<Int>()
    for (i in codonList.indices) {
        if (codon == codonList[i]) {
            positions.add(i)
        }
    }
    return positions
}
/**
 * Given a list of codons and a codon as input, return the position(s) of the codon in the list.
 *
 * @param codonList A list of codons.
 * @param codon A codon to search for in the list.
 * @return A list of integers representing the position(s) of the codon in the list.
 *
 * Example:
 * get_codon_position(listOf("AUG", "UCA", "UAA", "AGU", "UCA", "UGA"), "UCA") // [1, 4]
 * get_codon_position(listOf("AUG", "UCA", "UAA", "AGU", "UCA", "UGA"), "UGG") // []
 */
fun get_codon_position(codonList: List<String>, codon: String): List<Int> {
/**
 * Given a list of codons and a codon as input, return the position(s) of the codon in the list.
 *
 * @param codonList A list of codons.
 * @param codon A codon to search for in the list.
 * @return A list of integers representing the position(s) of the codon in the list.
 *
 * Example:
 * get_codon_position(listOf("AUG", "UCA", "UAA", "AGU", "UCA", "UGA"), "UCA") // [1, 4]
 * get_codon_position(listOf("AUG", "UCA", "UAA", "AGU", "UCA", "UGA"), "UGG") // []
 */
fun get_codon_position(codonList: List<String>, codon: String): List<Int> {

    val positions = mutableListOf<Int>()
    for (i in codonList.indices) {
        if (codon == codonList[i]) {
            positions.add(i)
        }
    }
    return positions
}