/**
 * Given a dictionary with three keys 'title', 'author', and 'category',
 * write a function that returns the value of 'title' if 'author' is not present,
 * returns the value of 'author' if 'category' is not present, and returns the
 * value of 'category' otherwise. If none of the keys are present in the dictionary,
 * return an empty string.
 *
 * @param dictionary A dictionary containing 'title', 'author', and/or 'category'.
 * @return The value of 'title', 'author', 'category', or an empty string.
 *
 * Examples:
 * nestedTernaryOperators(mapOf("title" to "Python for Journalists")) // "Python for Journalists"
 * nestedTernaryOperators(mapOf("author" to "John Smith")) // "John Smith"
 * nestedTernaryOperators(mapOf("category" to "Technology")) // "Technology"
 * nestedTernaryOperators(mapOf("language" to "Python")) // ""
 */
fun nestedTernaryOperators(dictionary: Map<String, String>): String {

    return dictionary["title"] ?: dictionary["author"] ?: dictionary["category"] ?: ""
}
/**
 * Given a dictionary with three keys 'title', 'author', and 'category',
 * write a function that returns the value of 'title' if 'author' is not present,
 * returns the value of 'author' if 'category' is not present, and returns the
 * value of 'category' otherwise. If none of the keys are present in the dictionary,
 * return an empty string.
 *
 * @param dictionary A dictionary containing 'title', 'author', and/or 'category'.
 * @return The value of 'title', 'author', 'category', or an empty string.
 *
 * Examples:
 * nestedTernaryOperators(mapOf("title" to "Python for Journalists")) // "Python for Journalists"
 * nestedTernaryOperators(mapOf("author" to "John Smith")) // "John Smith"
 * nestedTernaryOperators(mapOf("category" to "Technology")) // "Technology"
 * nestedTernaryOperators(mapOf("language" to "Python")) // ""
 */
fun nestedTernaryOperators(dictionary: Map<String, String>): String {
/**
 * Given a dictionary with three keys 'title', 'author', and 'category',
 * write a function that returns the value of 'title' if 'author' is not present,
 * returns the value of 'author' if 'category' is not present, and returns the
 * value of 'category' otherwise. If none of the keys are present in the dictionary,
 * return an empty string.
 *
 * @param dictionary A dictionary containing 'title', 'author', and/or 'category'.
 * @return The value of 'title', 'author', 'category', or an empty string.
 *
 * Examples:
 * nestedTernaryOperators(mapOf("title" to "Python for Journalists")) // "Python for Journalists"
 * nestedTernaryOperators(mapOf("author" to "John Smith")) // "John Smith"
 * nestedTernaryOperators(mapOf("category" to "Technology")) // "Technology"
 * nestedTernaryOperators(mapOf("language" to "Python")) // ""
 */
fun nestedTernaryOperators(dictionary: Map<String, String>): String {

    return dictionary["title"] ?: dictionary["author"] ?: dictionary["category"] ?: ""
}