/**
 * This exercise requires creating a list of elements based on certain conditions
 */
fun createListOfElements(element1: String, element2: String, element3: String): List<String> {

    // Create an empty list called 'elementList'
    val elementList = mutableListOf<String>()

    // Check if all the given elements are present in the list 'elementList'
    if (element1 in elementList && element2 in elementList && element3 in elementList) {
        // If all elements are already present, return an appropriate message
        return listOf("All elements are already present in the list.")
    }

    // Check if both element1 and element3 are rocks
    if (element1 == "rock" && element3 == "rock") {
        // Add element1, element2, and element3 to the list in the respective order
        elementList.add(element1)
        elementList.add(element2)
        elementList.add(element3)

        // Return the updated list 'elementList'
        return elementList
    }

    // Check if element2 is a mineral or fossil
    if (element2 == "mineral" || element2 == "fossil") {
        // Add element1 and element3
        elementList.add(element1)
        elementList.add(element3)
    }

    return elementList
}
/**
 * This exercise requires creating a list of elements based on certain conditions
 */
fun createListOfElements(element1: String, element2: String, element3: String): List<String> {
/**
 * This exercise requires creating a list of elements based on certain conditions
 */
fun createListOfElements(element1: String, element2: String, element3: String): List<String> {

    // Create an empty list called 'elementList'
    val elementList = mutableListOf<String>()

    // Check if all the given elements are present in the list 'elementList'
    if (element1 in elementList && element2 in elementList && element3 in elementList) {
        // If all elements are already present, return an appropriate message
        return listOf("All elements are already present in the list.")
    }

    // Check if both element1 and element3 are rocks
    if (element1 == "rock" && element3 == "rock") {
        // Add element1, element2, and element3 to the list in the respective order
        elementList.add(element1)
        elementList.add(element2)
        elementList.add(element3)

        // Return the updated list 'elementList'
        return elementList
    }

    // Check if element2 is a mineral or fossil
    if (element2 == "mineral" || element2 == "fossil") {
        // Add element1 and element3
        elementList.add(element1)
        elementList.add(element3)
    }

    return elementList
}