会员
众包
新闻
博问
AI培训
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
王爷爱吃秋刀鱼
博客园
首页
新随笔
联系
订阅
管理
2019年8月16日
数组中超过一半的数字
摘要: 1 class Solution { 2 public int majorityElement(int[] nums) { 3 4 int times=1; 5 int result = nums[0]; 6 for(int i=1;i<nums.length;i++) 7 { 8 if(times==0) 9 { 10 result = nums[i]; 11 times=1; 12 } 13
阅读全文
posted @ 2019-08-16 17:53 王爷爱吃秋刀鱼
阅读(192)
评论(0)
推荐(0)
编辑
公告