摘要:
给你一个整数数组 nums ,请你找出数组中乘积最大的连续子数组(该子数组中至少包含一个数字),并返回该子数组所对应的乘积。 function maxProduct(nums) { let maxsum = Math.max(...nums); if(nums.length == 1){ retur 阅读全文
posted @ 2020-06-18 16:26
671_MrSix
阅读(134)
评论(0)
推荐(0)
摘要:
给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现两次。找出那个只出现了一次的元素。 function singleNumber(nums) { let arr = [] for(let i = 0;i < nums.length;i++){ let item = nums[i] 阅读全文
posted @ 2020-06-18 15:30
671_MrSix
阅读(111)
评论(0)
推荐(0)
摘要:
给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 const lengthOfLongestSubstring = (s) => { const length = s.length if(length < 2) return length let res = 0 for(let i 阅读全文
posted @ 2020-06-18 14:32
671_MrSix
阅读(194)
评论(0)
推荐(0)

浙公网安备 33010602011771号