>325

result = ary.zip([nil]+ary).select{|x,y| x!=y}.map(&:first)