11. The Party Reservation Filter Module от Functional Programming - Exercises
Здравейте, не мога да си открия грешката в задачата, дава ми 80/100. Може би трябва да се ползва Map, за да се реши?
https://pastebin.com/5WEzfhEJ
Условие:
* The Party Reservation Filter Module
You are a young and talented developer. The first task you need to do is to implement a filtering module to a party reservation software. First, The Party Reservation Filter Module (TPRF Module for short) is passed a list with invitations. Next the TPRF receives a sequence of commands that specify if you need to add or remove a given filter.
TPRF Commands are in the given format {command;filter type;filter parameter}
You can receive the following TPRF commands: "Add filter", "Remove filter" or "Print". The possible TPRF filter types are: "Starts with", "Ends with", "Length" and "Contains". All TPRF filter parameters will be a string (or an integer for the length filter).
The input will end with a "Print" command. See the examples below:
Examples
Input :
Peter Misha Slav
Add filter;Starts with;P
Add filter;Starts with;M
Output Slav
Input :
Peter Misha John
Add filter;Starts with;P
Add filter;Starts with;M
Remove filter;Starts with;M
Output: Misha John
Благодаря много! Разбрах, че ми е грешен подхода, но се връщам няколко пъти и не успявам да пренапиша кода.