This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
def has_pair_with_sum(a_list, target): | |
if len(a_list) < 2: | |
return False | |
i, j = 0, len(a_list) - 1 | |
while i < j: | |
min_value = a_list[i] |
OlderNewer