add binary search and index solution