Ovce
Mirko is having a dream in which sheep were placed between fences calmly eat grass. The dream has become a nightmare when the wolves started to eat the sheep.
Fortunately, the sheep can defend themselves if there are more sheep than wolves between two fences. In this case the sheep will eat the wolves. Otherwise the wolves will eat all the sheep between the two fences.
Write a program that will load the string which is composed of the characters # (fence), O (sheep) and V (wolf). The program should print a string that
describes the situation after the wolves have eaten the sheep you they can.
That is:
if the sheep eat some wolves between two fences, then between the two fences should remain the only signs of O; if the wolves eat sheep between any two fences, then between the two fences should remain the only signs of V.
Input:
#OOOV#VV#Output:
#OOO#VV#Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.