Party Reservation Filter Module - Functional Programming - C#
Здравейте,
Получавам 60/100 на тази задача: https://pastebin.com/F7e9Njxx и не мога да открия какво пропускам. Не съм я решила по много "функционален" начин, затова ще бъда благодарна и на малко съвети в тази посока.
Ето и условието на задачата:
Problem 11. Party Reservation Filter Module
You need to implement a filtering module to a party reservation software. First, to the Party Reservation Filter Module (PRFM for short) is passed a list with invitations. Next the PRFM receives a sequence of commands that specify whether you need to add or remove a given filter.
Each PRFM command is in the given format:
"{command;filter type;filter parameter}"
You can receive the following PRFM commands:
- "Add filter"
- "Remove filter"
- "Print"
The possible PRFM filter types are:
- "Starts with"
- "Ends with"
- "Length"
- "Contains"
All PRFM filter parameters will be a string (or an integer only for the "Length" filter). Each command will be valid e.g. you won’t be asked to remove a non-existent filter. The input will end with a "Print" command, after which you should print all the party-goers that are left after the filtration. See the examples below:
Examples
Input |
Output |
Pesho Misho Slav Add filter;Starts with;P Add filter;Starts with;M |
Slav |
Pesho Misho Jica Add filter;Starts with;P Add filter;Starts with;M Remove filter;Starts with;M |
Misho Jica |