代码来自:https://www.cnblogs.com/ningvsban/p/3590722.html,感觉实现的方式不错(做了一点小小修改) public static ArrayList getDiffNo(int count, int n){ // 生成count个[0-n) 不重复的随机数,左开右闭 // list 用来保存这些随机数 ArrayList list = new ArrayList(); Random rand = new Random(); boolean[] boo…