for(var i = 0; i < 200000; i += 50){
// Do Stuff
}
The only way I can think to do it is to do the following
我能想到的唯一方法就是做到以下几点
arr = [0,50,100,...,200000]
arr.each do |i|
// Do Stuff
end
If that is in fact the only way. How could you build that array quickly?
如果这实际上是唯一的方法。你怎么能快速建立这个阵列?
2 个解决方案
#2
1
(0...200000).step(50) do |i|
# Do stuff
end
#1
#2
1
(0...200000).step(50) do |i|
# Do stuff
end