2. Change List - Lists Exercise
Защо ми дава Runtime Error на единия от тестовете, помагайте колеги?
Решение - https://pastebin.com/b52PTZZu
Условие:
Write a program, which reads a list of integers from the console and receives commands, which manipulate the list. Your program may receive the following commands:
- Delete {element} – delete all elements in the array, which are equal to the given element
- Insert {element} {position} – insert element and the given position
You should stop the program when you receive the command "end". Print all numbers in the array separated with single whitespace.
Examples
Input |
Output |
1 2 3 4 5 5 5 6 Delete 5 Insert 10 1 Delete 5 end |
1 10 2 3 4 6 |
20 12 4 319 21 31234 2 41 23 4 Insert 50 2 Insert 50 5 Delete 4 end |
20 12 50 319 50 21 31234 2 41 23
|