add find element start index and end index with complexity less than
O(n);