Customers purchased a secret list of book will receive prizes. Notice the order of the books matters.
Also there can be a keyword “anything” in the secretBookList which can be used for any type of book.
Input:
secretBookLists, List<List<String>>.
customerPurchasedList, List<String>, represent the books the customer purchased.
Output:
output true if the customer is a winner else output false.
(Notice: The order of the lists within the secretBookLists matters. )
Example1:
secretBookLists = [[book1, book2], [book3, book2]]
customerPurchasedList = [book1, book2, book4, book3, book2]
Output:
True
Example2:
secretBookLists = [[book3, anything, book2]]
customerPurchasedList = [book3, book1, book2]
Output:
True
Example3:
secretBookLists = [[book3, anything, book2]]
customerPurchasedList = [book3, book5, book1, book2]
Output:
False
Copyright © A++ Code Bootcamp 2023