boom莎卡拉卡

关注

LeetCode 1 两数求和

boom莎卡拉卡

关注

阅读 135

2022-02-28

Use go language to complete the task of summing two numbers
func twoSum(nums []int, target int) []int {
      var re []int
      for i:=0;i<len(nums)-1;i++{
          for j:=i+1;j<len(nums);j++{
              if nums[i] + nums[j] ==target{
                  re = []int{i,j}
                  break
              }
          }
      }
      return re
}

相关推荐

千行

LeetCode 1 两数之和

千行 49 0 0

东言肆语

【LeetCode】1两数之和

东言肆语 116 0 0

进击的铁雾

Leetcode 1:两数之和

进击的铁雾 123 0 0

承蒙不弃

C++两数求和

承蒙不弃 21 0 0

那小那小

LeetCode1.两数之和

那小那小 66 0 0

Sikj_6590

LeetCode-1:两数之和

Sikj_6590 80 0 0

快乐小鱼儿_9911

LeetCode 1. 两数之和

快乐小鱼儿_9911 20 0 0

自由情感小屋

LeetCode 1.两数之和

自由情感小屋 84 0 0

陈情雅雅

【LeetCode】1. 两数之和

陈情雅雅 10 0 0

非凡兔

LeetCode-1-两数之和

非凡兔 71 0 0

精彩评论(0)

0 0 举报