Description
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
My Solution
Python
1 |
|
- 想法:暴力解法
Best Solution
Python
1 |
# 使用了字典,相当于hash |
- 想法:
- 使用字典
- enumerate()
近期评论