Flood-fill (1-d dp)

i did not understand , how to fill color of suare