/**
 * Given a bookshelf containing books, return a tuple with books within the specified indexes.
 *
 * @param bookshelf A list representing the bookshelf.
 * @param start The start index for slicing the bookshelf.
 * @param end The end index for slicing the bookshelf.
 * @return A list containing the books within the specified indexes.
 *
 * Example:
 * librarianTask(listOf("Book A", "Book B", "Book C", "Book D", "Book E", "Book F"), 2, 5) ->
 * listOf("Book C", "Book D", "Book E", "Book F")
 */
fun librarianTask(bookshelf: List<String>, start: Int, end: Int): List<String> {

    // Check if the provided indexes are valid
    if (start < 0 || end >= bookshelf.size || start > end) {
        return emptyList()
    }

    // Slice the bookshelf to get the desired books
    val selectedBooks = bookshelf.subList(start, end + 1)

    // Return the selected books
    return selectedBooks
}
/**
 * Given a bookshelf containing books, return a tuple with books within the specified indexes.
 *
 * @param bookshelf A list representing the bookshelf.
 * @param start The start index for slicing the bookshelf.
 * @param end The end index for slicing the bookshelf.
 * @return A list containing the books within the specified indexes.
 *
 * Example:
 * librarianTask(listOf("Book A", "Book B", "Book C", "Book D", "Book E", "Book F"), 2, 5) ->
 * listOf("Book C", "Book D", "Book E", "Book F")
 */
fun librarianTask(bookshelf: List<String>, start: Int, end: Int): List<String> {
/**
 * Given a bookshelf containing books, return a tuple with books within the specified indexes.
 *
 * @param bookshelf A list representing the bookshelf.
 * @param start The start index for slicing the bookshelf.
 * @param end The end index for slicing the bookshelf.
 * @return A list containing the books within the specified indexes.
 *
 * Example:
 * librarianTask(listOf("Book A", "Book B", "Book C", "Book D", "Book E", "Book F"), 2, 5) ->
 * listOf("Book C", "Book D", "Book E", "Book F")
 */
fun librarianTask(bookshelf: List<String>, start: Int, end: Int): List<String> {

    // Check if the provided indexes are valid
    if (start < 0 || end >= bookshelf.size || start > end) {
        return emptyList()
    }

    // Slice the bookshelf to get the desired books
    val selectedBooks = bookshelf.subList(start, end + 1)

    // Return the selected books
    return selectedBooks
}