v1 implementation
correct bug. reset start and end before the 2nd binary search
add basic test cases