Posts

Showing posts from March, 2017

Painter Partition Problem (Binary Search)

Image
Hello! This post is about solution of Codebuddy problem Painter Partition :  visit question here So, we will be looking at the implementation part of it using  Binary Search. We encourage you to try solving problem first by yourself but still if you are getting trouble then move on to tutorials. Here we require to  minimise the time taken to paint all boards  given the number of painters and time taken by each painter to paint a board: Please note that time taken will be minimised when board length per person is minimised. So, we will manipulate our problem and we will minimise the board length per person that will in turn minimise time taken. Constraints: 1.  Two painters cannot share a board to paint. 2.  A painter will paint only contiguous section of boards.