[1] 两数之和(golang)-leetcode
/*
* @lc app=leetcode.cn id=1 lang=golang
*
* [1] 两数之和
*/
// @lc code=start
//时间复杂度O(n^2)
func twoSum(nums []int, target int) []int {
for i := 0; i < len(nums)-1; i++ {
for j := i + 1; j < len(nums); j++ {
if nums[i]+num.
原创
2021-01-07 10:22:14 ·
94 阅读 ·
0 评论