Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Coding puzzle (4)
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00665368
Message ID:
00665609
Views:
28
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform