Lever's Castle

1. 两数之和

June 17, 2019

https://leetcode-cn.com/problems/two-sum/

func twoSum(nums []int, target int) []int {
    for i, v1 := range nums {
        remaining := target - v1
        for j, v2 := range nums[i+1:] {
            if remaining == v2 {
                return []int{i, j + i + 1}
            }
        }
    }
    return []int{}
}

Lever

痕迹
没有过去,就没法认定现在的自己