Amazon interview question

Implement a paint or fill function