Created
June 7, 2020 04:16
-
-
Save a7me63azzab/87b8edd8ccaf82a500e65dfbef5105d3 to your computer and use it in GitHub Desktop.
Play With LeetCode [GoLang] [Problem Solving]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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