• Can anybody help?

Question related to mission Painting Wall

 

can someone give a hint? How can I apply the binary search to this task?

Thanks!