/**
 * Takes the start and end age range (inclusive) and a list of excluded ages and returns a list of animals
 * within the given age range, excluding the ones with ages in the excluded list.
 */
fun findAnimals(startAge: Int, endAge: Int, excludedAges: List<Int>): List<String> {

    val animals = listOf("dog", "cat", "rabbit", "hamster", "guinea pig", "parrot", "turtle", "goldfish")
    val validAnimals = mutableListOf<String>()

    for (age in startAge..endAge) {
        if (age !in excludedAges) {
            validAnimals.add(animals[age - 1])
        }
    }

    return validAnimals
}
/**
 * Takes the start and end age range (inclusive) and a list of excluded ages and returns a list of animals
 * within the given age range, excluding the ones with ages in the excluded list.
 */
fun findAnimals(startAge: Int, endAge: Int, excludedAges: List<Int>): List<String> {
/**
 * Takes the start and end age range (inclusive) and a list of excluded ages and returns a list of animals
 * within the given age range, excluding the ones with ages in the excluded list.
 */
fun findAnimals(startAge: Int, endAge: Int, excludedAges: List<Int>): List<String> {

    val animals = listOf("dog", "cat", "rabbit", "hamster", "guinea pig", "parrot", "turtle", "goldfish")
    val validAnimals = mutableListOf<String>()

    for (age in startAge..endAge) {
        if (age !in excludedAges) {
            validAnimals.add(animals[age - 1])
        }
    }

    return validAnimals
}