Skip to content

Instantly share code, notes, and snippets.

@a7me63azzab
Created June 7, 2020 04:16
Show Gist options
  • Save a7me63azzab/87b8edd8ccaf82a500e65dfbef5105d3 to your computer and use it in GitHub Desktop.
Save a7me63azzab/87b8edd8ccaf82a500e65dfbef5105d3 to your computer and use it in GitHub Desktop.
Play With LeetCode [GoLang] [Problem Solving]
func twoSum(nums []int, target int) []int {
result := []int{}
for i:= 0; i< len(nums); i++{
if i < len(nums){
for j:= i+1 ; j < len(nums) ; j++{
if j < len(nums){
if nums[i] + nums[j] == target {
result = append(result, i,j)
}
}
}
}
}
return result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment