Primes - allocate descendants to their ancestors: Difference between revisions

m
Line 2,321:
var idx = descendants[s].first_index {|x| x > maxsum }
 
for d in (descendants[s].slicefirst(0, idx+1)) {
ancestors[d] = (ancestors[s] + [s])
}
2,747

edits