/**
 * This function takes a list of scientists' data and an astronomer's name.
 * It searches for the astronomer's name in the list and modifies the elements in a nested ternary operation.
 * The scientist's name will be capitalized if the astronomer is a researcher and converted to lowercase if the astronomer is an observer.
 * The astronomer's role will be updated to "Supervisor" if the scientist's name starts with a consonant, otherwise it will be updated to "Junior".
 * The function returns the updated list of scientists' data.
 */
fun updateData(scientists: MutableList<MutableList<String>>, astronomer: String): MutableList<MutableList<String>> {

    for (scientist in scientists) {
        scientist[0] = if (astronomer == "researcher") scientist[0].capitalize() else scientist[0].toLowerCase()
        scientist[1] = if (scientist[0][0].toLowerCase() !in "aeiou") "Supervisor" else "Junior"
    }
    return scientists
}

// Example usage
/**
 * This function takes a list of scientists' data and an astronomer's name.
 * It searches for the astronomer's name in the list and modifies the elements in a nested ternary operation.
 * The scientist's name will be capitalized if the astronomer is a researcher and converted to lowercase if the astronomer is an observer.
 * The astronomer's role will be updated to "Supervisor" if the scientist's name starts with a consonant, otherwise it will be updated to "Junior".
 * The function returns the updated list of scientists' data.
 */
fun updateData(scientists: MutableList<MutableList<String>>, astronomer: String): MutableList<MutableList<String>> {
/**
 * This function takes a list of scientists' data and an astronomer's name.
 * It searches for the astronomer's name in the list and modifies the elements in a nested ternary operation.
 * The scientist's name will be capitalized if the astronomer is a researcher and converted to lowercase if the astronomer is an observer.
 * The astronomer's role will be updated to "Supervisor" if the scientist's name starts with a consonant, otherwise it will be updated to "Junior".
 * The function returns the updated list of scientists' data.
 */
fun updateData(scientists: MutableList<MutableList<String>>, astronomer: String): MutableList<MutableList<String>> {

    for (scientist in scientists) {
        scientist[0] = if (astronomer == "researcher") scientist[0].capitalize() else scientist[0].toLowerCase()
        scientist[1] = if (scientist[0][0].toLowerCase() !in "aeiou") "Supervisor" else "Junior"
    }
    return scientists
}

// Example usage