すみません。上のは不要なセミコロンが入っていました。(動作は問題ないみたいですが)

a=[[1,2],3,4,5,[6,7],8,[9,10],[11,12],[13,14]]
tobj=[[]]*2
rslt1 = a.each_with_object([[],[]]) {|x,tary| tary.each_with_index{|n,i| x.instance_of?(Array) ? tary[i]<<x[i] : tary[i]<<x}}
rslt2 = a.each_with_object(tobj) {|x,tary| tary.each_with_index{|n,i| x.instance_of?(Array) ? tary[i]<<x[i] : tary[i]<<x}}
p rslt1,rslt2