>Bingo! Your solution is correct with one exception. I did not specify the >array must contain two numbers that sum to X. Changing your do while to >include an additional condition to check min_index < max_index - and >returning a no match exists if ever false - solves the problem.
actually, as I decrement max_index by 1 or increment min_index by 1, the case you talk about, I cover by the last else if.
else if min_index = max_index
return "Failure!"
endif