Painter problem

not getting correct output

I have edited your code… Try to submit it now…