|
|
@ -81,23 +81,6 @@ p dests.map(&:begin).min
|
|
|
|
# }
|
|
|
|
# }
|
|
|
|
# .min
|
|
|
|
# .min
|
|
|
|
|
|
|
|
|
|
|
|
# seeds = seeds
|
|
|
|
|
|
|
|
# .each_slice(2)
|
|
|
|
|
|
|
|
# .map {|start, length| (start...start+length) }
|
|
|
|
|
|
|
|
# reversed = mappings
|
|
|
|
|
|
|
|
# .map {|mapping|
|
|
|
|
|
|
|
|
# Mapping.new(
|
|
|
|
|
|
|
|
# mapping.conversions.map {|c|
|
|
|
|
|
|
|
|
# Conversion.new((c.dest_start...c.dest_start+c.source_range.size), c.source_range.begin)
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
# )
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
# .reverse
|
|
|
|
|
|
|
|
# p (0..).find {|i|
|
|
|
|
|
|
|
|
# source = reversed.inject(i) {|cur, mapping| mapping[cur] }
|
|
|
|
|
|
|
|
# seeds.any? { _1.cover?(source) }
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# seeds = seeds
|
|
|
|
# seeds = seeds
|
|
|
|
# .each_slice(2)
|
|
|
|
# .each_slice(2)
|
|
|
|
# .map {|start, length| (start...start+length) }
|
|
|
|
# .map {|start, length| (start...start+length) }
|
|
|
@ -110,6 +93,14 @@ reversed = mappings
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.reverse
|
|
|
|
.reverse
|
|
|
|
|
|
|
|
# p (0..).find {|i|
|
|
|
|
|
|
|
|
# source = reversed.inject(i) {|cur, mapping| mapping[cur] }
|
|
|
|
|
|
|
|
# seeds.any? { _1.cover?(source) }
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# seeds = seeds
|
|
|
|
|
|
|
|
# .each_slice(2)
|
|
|
|
|
|
|
|
# .map {|start, length| (start...start+length) }
|
|
|
|
lowest = seeds
|
|
|
|
lowest = seeds
|
|
|
|
.flat_map(&:minmax)
|
|
|
|
.flat_map(&:minmax)
|
|
|
|
.filter_map {|seed|
|
|
|
|
.filter_map {|seed|
|
|
|
|