Hi guys... I'm taking part in the South-African Computer Olympiad and I just started learning Python (about a week now)...
This is one of the questions in one of the previous papers:

Description
An interesting fact is that if one places some red
tomatoes amongst unripe tomatoes, adjacent unripe
tomatoes will start reddening.
Task
Suppose you have a row of N tomatoes, of which R
are...