Swift 获取不同数据的数组
funcnumber(end:Int,count:Int) {
varstartArr =Array(1...end)
varresultArr =Array(repeating:1, count: count)
varj =0
for i in 0...count{
letcurrentCount =UInt32(startArr.count- j)
letindex =Int(arc4random_uniform(currentCount))
resultArr[i] = startArr[index]
startArr[index] = startArr[Int(currentCount) -1]
j +=1
}
print(resultArr)
}