diff options
Diffstat (limited to 'benchmark/agbenchmark/challenges/deprecated/code/d2.3_import/artifacts_out/sample_code.py')
-rw-r--r-- | benchmark/agbenchmark/challenges/deprecated/code/d2.3_import/artifacts_out/sample_code.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/benchmark/agbenchmark/challenges/deprecated/code/d2.3_import/artifacts_out/sample_code.py b/benchmark/agbenchmark/challenges/deprecated/code/d2.3_import/artifacts_out/sample_code.py new file mode 100644 index 000000000..8b8a8e2ba --- /dev/null +++ b/benchmark/agbenchmark/challenges/deprecated/code/d2.3_import/artifacts_out/sample_code.py @@ -0,0 +1,11 @@ +from typing import List, Optional + + +def two_sum(nums: List, target: int) -> Optional[List[int]]: + seen = {} + for i, num in enumerate(nums): + complement = target - num + if complement in seen: + return [seen[complement], i] + seen[num] = i + return None |