1.20

1.20

这里写自定义目录标题

  • 1. 每日一题——石子游戏

1. 每日一题——石子游戏

class Solution {public boolean stoneGameIX(int[] stones) {int cnt0 = 0, cnt1 = 0, cnt2 = 0;for (int val : stones) {int type = val % 3;if (type == 0) {++cnt0;} else if (type == 1) {++cnt1;} else {++cnt2;}}if (cnt0 % 2 == 0) {return cnt1 >= 1 && cnt2 >= 1;}return cnt1 - cnt2 > 2 || cnt2 - cnt1 > 2;}
}

发布者:admin,转转请注明出处:http://www.yc00.com/news/1692511727a602526.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信