fork download
  1. f = ->a, b {a.zip(b).map {|c| (c.first...c.last).to_a}.inject(:|).size}
  2. p f.([1,3,5], [2,4,6])
  3. p f.([1,2], [5,6])
  4. p f.([100,1,2], [105,3,4])
Success #stdin #stdout 0s 28216KB
stdin
Standard input is empty
stdout
3
5
8