/**
 * As a librarian, you have a collection of books in your library and you need to search for a specific book.
 *
 * You need to implement a function 'librarianSearchBooks' that takes in two parameters:
 * - books: a list of books in the library
 * - search: a book to search for
 *
 * Your task is to find the position of the book in the list 'books' using a while loop and the 'in' statement,
 * and return the position as the output. If the book is not found in the library, return -1.
 *
 * Example:
 * librarianSearchBooks(listOf("Python Crash Course", "Clean Code", "The Pragmatic Programmer"), "Clean Code")
 * Output: 1
 *
 * librarianSearchBooks(listOf("Introduction to Algorithms", "Design Patterns", "Code Complete"), "Code Complete")
 * Output: 2
 *
 * librarianSearchBooks(listOf("The Lean Startup", "Thinking, Fast and Slow", "Sapiens"), "Deep Work")
 * Output: -1
 */
fun librarianSearchBooks(books: List<String>, search: String): Int {

    var position = 0
    while (position < books.size) {
        if (books[position] == search) {
            return position
        }
        position++
    }
    return -1
}
/**
 * As a librarian, you have a collection of books in your library and you need to search for a specific book.
 *
 * You need to implement a function 'librarianSearchBooks' that takes in two parameters:
 * - books: a list of books in the library
 * - search: a book to search for
 *
 * Your task is to find the position of the book in the list 'books' using a while loop and the 'in' statement,
 * and return the position as the output. If the book is not found in the library, return -1.
 *
 * Example:
 * librarianSearchBooks(listOf("Python Crash Course", "Clean Code", "The Pragmatic Programmer"), "Clean Code")
 * Output: 1
 *
 * librarianSearchBooks(listOf("Introduction to Algorithms", "Design Patterns", "Code Complete"), "Code Complete")
 * Output: 2
 *
 * librarianSearchBooks(listOf("The Lean Startup", "Thinking, Fast and Slow", "Sapiens"), "Deep Work")
 * Output: -1
 */
fun librarianSearchBooks(books: List<String>, search: String): Int {
/**
 * As a librarian, you have a collection of books in your library and you need to search for a specific book.
 *
 * You need to implement a function 'librarianSearchBooks' that takes in two parameters:
 * - books: a list of books in the library
 * - search: a book to search for
 *
 * Your task is to find the position of the book in the list 'books' using a while loop and the 'in' statement,
 * and return the position as the output. If the book is not found in the library, return -1.
 *
 * Example:
 * librarianSearchBooks(listOf("Python Crash Course", "Clean Code", "The Pragmatic Programmer"), "Clean Code")
 * Output: 1
 *
 * librarianSearchBooks(listOf("Introduction to Algorithms", "Design Patterns", "Code Complete"), "Code Complete")
 * Output: 2
 *
 * librarianSearchBooks(listOf("The Lean Startup", "Thinking, Fast and Slow", "Sapiens"), "Deep Work")
 * Output: -1
 */
fun librarianSearchBooks(books: List<String>, search: String): Int {

    var position = 0
    while (position < books.size) {
        if (books[position] == search) {
            return position
        }
        position++
    }
    return -1
}