头歌 python 智慧棋盘 | 您所在的位置:网站首页 › 象棋棋盘歌 › 头歌 python 智慧棋盘 |
腾讯2024实习生在线笔试-0331
WZ_Richard: 大佬请问我第二题一直97%,可以帮我看看吗 public boolean[] canSorted (ListNode[] lists) { // 输入省略 int idx=0; boolean[] res = new boolean[n]; for (ListNode node : lists) { short i = 2; int pre = node.val; while (node.next!=null && i>0) { if (node.val>node.next.val) { i--; } node = node.next; } res[idx++] = i==1&&pre>node.val || i==2; } // 打印res } |
CopyRight 2018-2019 实验室设备网 版权所有 |