no need for this edge case
end is a dummy pointer for the 1st part, and for the leftmost range, test the A[start]
simplify the binary search
test A[start] for the leftmost range
for the 2nd binary search, pt start begins from the end of 1st search, no need to reset to zero
simplify the 2nd binary search and data variables