当前位置:网站首页>判断一组牌是否能成为顺子(大小王为14,15)
判断一组牌是否能成为顺子(大小王为14,15)
2022-07-22 09:57:00 【yangdachaoa】
public static boolean judge(int[] arr) {
if (isEmpty(arr) || arr.length == 0) {
return true;
}
int len = arr.length;
Arrays.sort(arr);
for (int i = 0; i < len - 1; i++) {
if (arr[i + 1] - arr[i] != 1 || arr[i] == 14 || arr[i] == 15) {
return false;
}
}
return true;
}
边栏推荐
- 国产立体声音频数模D/A转换器DP4344替代兼容CS4344
- CCF 1-2题答题记录(2)
- Has the climate changed in Hebei and Zhejiang?
- Grafana panel - modify visual text and background colors
- PHP curl 请求中设置 proxy 方法
- 最强屏幕工具ShareX v14.0.1
- Day3:分支结构
- arguments
- MySQL 查看表结构最后变更时间
- Future prospects and trends of IT outsourcing service industry in various fields
猜你喜欢
Grafana panel - about conversion
NLP text classification top meeting paper reading notes for natural language processing (2)
万兴PDF专家v8.3.8.1253专业版
The problem that double type cannot be accurately calculated
An analysis of the CPU surge of an RFID tag management system in.Net
由浅入深详解NLP中的Adapter技术
Grafana panel - override field values
如何不获取root权限使用第三方主题:MIUI篇
Rongyun ramble: no one can avoid "video conference"
arguments
随机推荐
Pytest interface automated testing framework | pytest installation and rules
About human resource outsourcing companies
el-table获取当前行index的方法
如何不获取root权限使用第三方主题:MIUI篇
Force deduction solution summary 1089- duplicate zero
Research on the principle of Tencent persistence framework mmkv
博士申请 | 香港大学倪卓娴教授招收物联网与机器学习方向全奖博士生
由浅入深详解NLP中的Adapter技术
Leetcode notes
7.21 排列与二进制
Glibc source code analysis
"Pilot Cup" is coming! Summon the strongest brain in scientific computing, 360000 prize pool waiting for you
The force deduction method summarizes the number of 1252 odd value cells
[learn C and fly] Chapter 3 branch structure (exercise 3.1 simple guessing game)
7.18 正方形数组的数目
有向图的连通性
Force deduction solution summary 513- find the value of the lower left corner of the tree
Rongyun ramble: Communication Center
JS advanced - lexical scope
【commons-beanutils专题】004- BeanUtils 专题