#K82562. Library Management System
Library Management System
Library Management System
You are required to implement a Library Management System that maintains a collection of books. Each book has a title, author, and publication year. The system should support the following operations:
- ADD: Add a new book to the library.
- REMOVE: Remove a book by its title (case-insensitive).
- SEARCH_TITLE: Search for books whose titles contain a given substring (case-insensitive).
- SEARCH_AUTHOR: Search for books by authors whose name contains a given substring (case-insensitive).
- SEARCH_YEAR: Search for books published in a given year.
For REMOVE and SEARCH operations, output the corresponding result immediately. In SEARCH operations, if no books match the search criteria, output 'None'. When multiple books match, output their titles separated by commas (without extra spaces) in the order they were added.
Note: If any formulas need to be displayed, use the LaTeX format. (No formulas are required for this problem.)
inputFormat
The first line of input contains an integer N denoting the number of operations. Each of the following operations is provided in one of the following formats:
ADD
REMOVE
SEARCH_TITLE
SEARCH_AUTHOR
SEARCH_YEAR
Process the operations sequentially.
outputFormat
For each REMOVE and SEARCH operation, print the result on a new line.
- For REMOVE, print "True" if the book was successfully removed, otherwise print "False".
- For SEARCH operations, if one or more books match, print their titles separated by commas (with no extra spaces) in the order they were added; if no books match, print "None".## sample
5
ADD
1984
George Orwell
1949
ADD
Animal Farm
George Orwell
1945
SEARCH_TITLE
Farm
REMOVE
1984
Animal Farm
True
</p>