Browse Source

twosumfix

content-update
OGordoo 5 years ago
parent
commit
3dbb22056f
  1. 9
      subjects/twosum.en.md

9
subjects/twosum.en.md

@ -1,17 +1,22 @@
## twosum ## twosum
### Instructions: ### Instructions
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
Given an array of integers, return indexes of the two numbers such that they add up to a specific target.
If there are more than one solution, return the first one. If there are more than one solution, return the first one.
If there are no solutions, return nil. If there are no solutions, return nil.
Expected function: Expected function:
```go ```go
func TwoSum(nums []int, target int) []int { func TwoSum(nums []int, target int) []int {
} }
``` ```
Here is a possible [program](TODO-LINK) to test your function : Here is a possible [program](TODO-LINK) to test your function :
```go ```go
package main package main

Loading…
Cancel
Save