1. Two Sum

2019-09-16

1. Two Sum

1
2
3
4
5
6
7
8
9
10
11
# @param {Integer[]} nums
# @param {Integer} target
# @return {Integer[]}
def two_sum(nums, target)
value = Array.new
nums.each_with_index do|num,index|
return [value.index(num),index] if value.include?(num)
value<<target-num
end
[]
end
-->