![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
Archer_tl
这个作者很懒,什么都没留下…
展开
-
2.每日一题 - leetcode 3 无重复字符的最长子串
无重复字符的最长子串 代码(JavaScript) /** * @param {string} s * @return {number} */ var lengthOfLongestSubstring = function (s) { let arr = []; let maxLength = 0; for (item of s) { let index = arr.findIndex(num => num === item) if (index > 0) {原创 2020-09-27 15:25:22 · 69 阅读 · 0 评论 -
1.每日一题 - leetcode 1 两数之和
两数之和 代码(JavaScript) var twoSum = function(nums, target) { let i, j; nums.find((item,index) => { const num = target - item const otherNum = nums.find((other,indey) => { if(other === num && index !== indey) { i = inde原创 2020-08-31 14:52:58 · 90 阅读 · 0 评论