热门标签
更多>
搜索结果
查询Tags标签: maxConsecutive,共有 2条记录-
LeetCode-128 最长连续序列
class Solution {public int longestConsecutive(int[] nums) {Set<Integer> set = new HashSet<Integer>();int length = nums.length;for(int i=0;i<length;i++)set.add(nums[i]);int maxConsecutive = 0;int nowConsecutive = 0;for(int num:set){ // …
2021/12/13 23:24:34 人评论 次浏览 -
LeetCode-128 最长连续序列
class Solution {public int longestConsecutive(int[] nums) {Set<Integer> set = new HashSet<Integer>();int length = nums.length;for(int i=0;i<length;i++)set.add(nums[i]);int maxConsecutive = 0;int nowConsecutive = 0;for(int num:set){ // …
2021/12/13 23:24:34 人评论 次浏览