文件名称:leetcode下载-daily-study:每天学习
文件大小:33KB
文件格式:ZIP
更新时间:2024-07-19 14:06:16
系统开源
leetcode下载 study every day 1.Two-sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution. Difficulty: Easy link: Example: Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1]. 个人解答(2016/10/19): 题意为给出一个数组,给一个特定的值,然后函数是可以返回两个数字的索引(它们之和为给出的特定的值)。 直接采用两层遍历就可以解决问题,保存好length的值可以节省100ms的运行时间。 Run Time: 179ms Language: javascript code: /** * @param
【文件预览】:
daily-study-master
----README.md(86KB)