06. Wardrobe - Sets and Dictionaries Advanced - Exercise
Здравейте!
В Judge следното решение https://pastebin.com/pGVeBD1n ми дава 0/100 при и 3-те нулеви теста верни.
Моля за помощ!
Условие:
Create a program that helps you decide what clothes to wear from your wardrobe. You will receive the clothes, which are currently in your wardrobe, sorted by their color in the following format:
"{color} -> {item1},{item2},{item3}…"
If you receive a certain color, which already exists in your wardrobe, just add the clothes to its records. You can also receive repeating items for a certain color and you have to keep their count.
In the end, you will receive a color and a piece of clothing, which you will look for in the wardrobe, separated by a space in the following format:
"{color} {clothing}"
Your task is to print all the items and their count for each color in the following format:
"{color} clothes:
* {item1} - {count}
* {item2} - {count}
* {item3} - {count}
…
* {itemN} - {count}"
If you find the item you are looking for, you need to print "(found!)" next to it:
"* {itemN} - {count} (found!)"
Input
- On the first line, you will receive n - the number of lines of clothes, which you will receive.
- On the next n lines, you will receive the clothes in the format described above.
Output
- Print the clothes from your wardrobe in the format described above
Examples
Input |
Output |
4 Blue -> dress,jeans,hat Gold -> dress,t-shirt,boxers White -> briefs,tanktop Blue -> gloves Blue dress |
Blue clothes: * dress - 1 (found!) * jeans - 1 * hat - 1 * gloves - 1 Gold clothes: * dress - 1 * t-shirt - 1 * boxers - 1 White clothes: * briefs - 1 * tanktop - 1 |
4 Red -> hat Red -> dress,t-shirt,boxers White -> briefs,tanktop Blue -> gloves White tanktop |
Red clothes: * hat - 1 * dress - 1 * t-shirt - 1 * boxers - 1 White clothes: * briefs - 1 * tanktop - 1 (found!) Blue clothes: * gloves - 1
|
5 Blue -> shoes Blue -> shoes,shoes,shoes Blue -> shoes,shoes Blue -> shoes Blue -> shoes,shoes Red tanktop |
Blue clothes: * shoes - 9 |
Благодаря на всички отзовали се!