:type nums: List[int] :type target: int :rtype: List[int]
(nums, target)
| 12 | from __future__ import print_function |
| 13 | |
| 14 | def twoSum(nums, target): |
| 15 | """ |
| 16 | :type nums: List[int] |
| 17 | :type target: int |
| 18 | :rtype: List[int] |
| 19 | """ |
| 20 | chk_map = {} |
| 21 | for index, val in enumerate(nums): |
| 22 | compl = target - val |
| 23 | if compl in chk_map: |
| 24 | indices = [chk_map[compl], index] |
| 25 | print(indices) |
| 26 | return [indices] |
| 27 | else: |
| 28 | chk_map[val] = index |
| 29 | return False |
nothing calls this directly
no outgoing calls
no test coverage detected