摘要: class Solution { public int singleNumber(int[] nums) { int res=0; for(int i=0;i>i)&1; res|=(sum%3)<<i; } return res; } } 阅读全文
posted @ 2017-10-08 12:20 Weiyu Wang 阅读(90) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int candy(int[] ratings) { int[] candies=new int[ratings.length]; for(int i=0;i=0;i--) if(ratings[i]>ratings[i+1]) candies[i]=M... 阅读全文
posted @ 2017-10-08 12:10 Weiyu Wang 阅读(149) 评论(0) 推荐(0) 编辑