/**
 * Given a species and an index, return the reptile located at the specified index.
 */
fun checkReptile(species: String, index: Int): String? {

    val reptiles = listOf("snake", "lizard", "crocodile", "turtle")

    if (index >= 0 && index < reptiles.size) {
        if ((species == "snake" || species == "lizard") && (index % 2 == 0) || (species == "crocodile" && index % 2 != 0)) {
            return reptiles[index]
        }
    }

    return null
}
/**
 * Given a species and an index, return the reptile located at the specified index.
 */
fun checkReptile(species: String, index: Int): String? {
/**
 * Given a species and an index, return the reptile located at the specified index.
 */
fun checkReptile(species: String, index: Int): String? {

    val reptiles = listOf("snake", "lizard", "crocodile", "turtle")

    if (index >= 0 && index < reptiles.size) {
        if ((species == "snake" || species == "lizard") && (index % 2 == 0) || (species == "crocodile" && index % 2 != 0)) {
            return reptiles[index]
        }
    }

    return null
}