Amazon Online Assessment (OA) - Secret Fruit List
A company is running a promotion. Customers who purchase a secret list of fruits will receive prizes. Note that the order of the fruits matters.
Also, there can be a keyword anything
in the secretFruitList which can be used for any type of fruit.
Examples
Example 1:
Input:
customerPurchasedList = [orange, mango, strawberry, watermelon, mango]
secretFruitLists = [[orange, mango], [watermelon, mango]]
Output: true
Example 2:
Input:
customerPurchasedList = [watermelon, orange, mango]
secretFruitLists = [[watermelon, anything, mango]]
Output: true
Example 3:
Input:
customerPurchasedList = [watermelon, apple, orange, mango]
secretFruitLists = [[watermelon, anything, mango]]