def merge_to_previous_string(array)
      array.each_with_index do |key, index|
        next unless key.length == 1

        array[index - 1][1] += key[0]
        array.delete_at(index)
      end
    end
def merge_to_previous_string(array)
      array.each_with_index do |key, index|
        next unless key.length == 1

        array[index - 1][1] += key[0]
        array.delete_at(index)
      end
    end
Sometimes long lines are wrapped into new lines, this function
 join them back

 [['a', 'b'], ['c']] #=> [['a', 'bc']]