Company: Yahoo
Difficulty: medium
Back to School Shopping It\'s back-to-school time! In order to buy school supplies for your kids, you have to go to 4 different types of shop: a bookshop to buy a workbook, a school shop to buy some glue, a sport store to buy a pair of sneakers, a stationery store to buy a pencil. Shopping for school isn\'t a fun hobby for you, so you started to search for the shortest path. Then you realized your town has many shops of these types, and it may take too long to evaluate all the paths one by one. So, before searching for the best path, you just want to count them. The type of a shop is encoded in an integer from 0 to 3: Type 0 is bookshop Type 1 is school shop Type 2 is sport store Type 3 is stationery Input Format As input, you get a description of your town in the following form: shops : a list of integers, telling the shop types. For example [2, 3, 1, 1, 0] means the shop at index 0 is a sport store, the shop at index 1 is a stationery store, the shops at indexes 2 and 3 are school sh