add solution for new question, using binary search