4 ms·
But he's defining the numbers with a property that makes them countably infinite? prefix = '0.'; queue = new Queue(prefix); for(;;){ s = qu
by yarg 3y ago
But he's defining the numbers with a property that makes them countably infinite?
prefix = '0.';
queue = new Queue(prefix);
for(;;){
s = queue.poll();
for(c:['0'...'9']){
queue.add(s + c);
}
}
When the constraint is "run forever" I don't think that the generator he defined produces results any different from the snippet above.