public static int makeUpComputer(int[] computers, int[] memory) { Arrays.sort(computers); Arrays.sort(memory); int index = 0; int count = 0; for (int i = 0; i < computers.length; i++) { // i:当前考察的电脑索引 for (int j = index; j < memory.length; j++) { // j:当前内存条索引 if (memory[j] >= computers[i]) { index = j+1; count++; break; } } } return count; }
点赞 评论

相关推荐

hwwhwh:同双非,有大厂实习其实也没啥用,主要看运气,等就行了
点赞 评论 收藏
分享
09-13 20:42
已编辑
门头沟学院 Java
哇哇的菜鸡oc:感觉包的有点过了,面试的时候很容易给人一种落差感,个人感觉,不喜勿喷
简历上的经历如何包装
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务