10. SoftUni Course Planning
Здравейте, колеги! Някой може ли да ми помогне с тази задачка, че вече се измъчих да я гледам? Judge ми дава 88/100.
Това е кодът- https://pastebin.com/URddYmG2
Това е условието:
Help planning the next Programming Fundamentals course by keeping track of the lessons that will be included in the course, as well as all the exercises for the lessons. On the first input line, you will receive the initial schedule of lessons and exercises that are going to be part of the next course, separated by a comma and a space ", ". Before the course starts, there are some changes to be made. Until you receive the "course start" command, you will be given some commands to modify the course schedule.
The possible commands are:
- Add:{lessonTitle} – add the lesson to the end of the schedule, if it does not exist.
- Insert:{lessonTitle}:{index} – insert the lesson to the given index, if it does not exist.
- Remove:{lessonTitle} – remove the lesson, if it exists.
- Swap:{lessonTitle}:{lessonTitle} – swap the position of the two lessons, if they exist.
Exercise:{lessonTitle} – add Exercise in the schedule right after the lesson index, if the lesson exists and there is no exercise already, in the following format "{lessonTitle}-Exercise". If the lesson doesn`t exist, add the lesson at the end of the course schedule, followed by the Exercise.
Note: Each time you Swap or Remove a lesson, you should do the same with the Exercises, if there are any following the lessons.
Thank you! :)