MLabs interview question

Define and write binary search algorithm. And implement a function that transforms a string in many different ways.