Finding a White-Black Pair

Have a look at the Finding a White-black Pair Problem in detail, and solve it using binary search.

White-black pair

Consider an array of white and black cells, where the first cell is white and the last cell is black. A white cell followed by a black cell in this array is called a white-black pair. Here is an example of an array with six white-black pairs.

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.