#K61782. Book Finder Challenge
Book Finder Challenge
Book Finder Challenge
In this challenge, you are given a fixed database of books. Each book has an id, title, author, publication year, and genre. Your task is to filter the books based on given search criteria and output the matching books sorted by their title in alphabetical order.
The criteria include:
- Author – the author of the book.
- Publication Year – the year the book was published.
- Genre – the genre of the book.
If a criterion is not provided (indicated by the input 'None'), it should be ignored. Each matching book must be printed on a separate line in CSV format: book_id,title,author,publication_year,genre
.
Any mathematical formulas should be formatted using LaTeX if applicable (though this problem does not include any formulas).
inputFormat
The input consists of three lines:
- The first line contains the author's name, or 'None' if no filtering by author is required.
- The second line contains the publication year, or 'None' if no filtering by publication year is required.
- The third line contains the genre, or 'None' if no filtering by genre is required.
outputFormat
For every book from the fixed database that matches all the provided criteria, output a line in CSV format:
book_id,title,author,publication_year,genre
The books must be printed in alphabetical order based on their title.
## sampleJohn Smith
None
None
1,Python Basics,John Smith,2015,Tech
3,Python Data Science,John Smith,2020,Science
</p>